Remove DropGraves() #1493

Merged
fyrchik merged 4 commits from fyrchik/frostfs-node:metabase-put into master 2024-11-14 06:47:05 +00:00
Owner

DropGraves() is always called after we have inhumed tombstones.
It iterates over the same set of object IDs and the possibility of inconsistenty (Inhume() was called, then we crash).
Merge both methods into a single one, atomically remove a tombstone.

DropGraves() is always called after we have inhumed tombstones. It iterates over the same set of object IDs and the possibility of inconsistenty (Inhume() was called, then we crash). Merge both methods into a single one, atomically remove a tombstone.
fyrchik added 4 commits 2024-11-13 10:05:40 +00:00
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
Unify with the other code, no functional changes.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
No functional changes.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
metabase: Merge Inhume() and DropGraves() for tombstones
Some checks failed
Tests and linters / Run gofumpt (pull_request) Successful in 1m26s
DCO action / DCO (pull_request) Failing after 1m42s
Vulncheck / Vulncheck (pull_request) Successful in 2m20s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m33s
Build / Build Components (pull_request) Successful in 2m47s
Tests and linters / Staticcheck (pull_request) Successful in 2m57s
Tests and linters / gopls check (pull_request) Successful in 3m4s
Tests and linters / Lint (pull_request) Successful in 3m49s
Tests and linters / Tests (pull_request) Successful in 4m43s
Tests and linters / Tests with -race (pull_request) Successful in 6m21s
f948e5c4ad
DropGraves() is only used to drop gravemarks after a tombstone
removal. Thus, it makes sense to do Inhume() and DropGraves() in one
transaction. It has less overhead and no unexpected problems in case
of sudden power failure.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
fyrchik force-pushed metabase-put from f948e5c4ad to 5c58c60362 2024-11-13 11:02:56 +00:00 Compare
fyrchik requested review from storage-core-committers 2024-11-13 11:03:00 +00:00
fyrchik requested review from storage-core-developers 2024-11-13 11:03:01 +00:00
acid-ant reviewed 2024-11-13 11:40:42 +00:00
@ -289,0 +288,4 @@
var res InhumeRes
err := db.boltDB.Batch(func(tx *bbolt.Tx) error {
res = InhumeRes{inhumedByCnrID: make(map[cid.ID]ObjectCounters)}
Member

Do we need to allocate it here once we don't want to return it?

Do we need to allocate it here once we don't want to return it?
Author
Owner

We need to initialize it here, because the function in Batch may be executed multiple times.

We need to initialize it here, because the function in `Batch` may be executed multiple times.
Author
Owner

Oh, wait, it should be returned, the result is used in the caller.

Oh, wait, it should be returned, the result is used in the caller.
Author
Owner

fixed

fixed
Author
Owner

extended the test to check the return value

extended the test to check the return value
acid-ant marked this conversation as resolved
fyrchik force-pushed metabase-put from 5c58c60362 to 11366f56b6 2024-11-13 12:27:39 +00:00 Compare
fyrchik changed title from Remove DropGraves() to WIP: Remove DropGraves() 2024-11-13 12:40:04 +00:00
fyrchik force-pushed metabase-put from 11366f56b6 to a35d21731a 2024-11-13 12:56:00 +00:00 Compare
fyrchik force-pushed metabase-put from a35d21731a to c4e40862e2 2024-11-13 12:56:24 +00:00 Compare
fyrchik changed title from WIP: Remove DropGraves() to Remove DropGraves() 2024-11-13 12:56:59 +00:00
fyrchik changed title from WIP: Remove DropGraves() to Remove DropGraves() 2024-11-13 12:57:00 +00:00
acid-ant approved these changes 2024-11-13 13:06:54 +00:00
dstepanov-yadro approved these changes 2024-11-13 13:18:16 +00:00
fyrchik force-pushed metabase-put from c4e40862e2 to b74189f7dc 2024-11-13 13:48:54 +00:00 Compare
fyrchik force-pushed metabase-put from b74189f7dc to df97011a5a 2024-11-13 13:49:28 +00:00 Compare
fyrchik merged commit d77a218f7c into master 2024-11-14 06:47:05 +00:00
fyrchik deleted branch metabase-put 2024-11-14 06:47:09 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-developers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#1493
No description provided.