WIP: Put a tombstone on a different shard if a target shard is read-only #1403

Closed
a-savchuk wants to merge 3 commits from a-savchuk/frostfs-node:put-tombstone-on-different-shard into master

3 commits

Author SHA1 Message Date
2dc934839a
[#1403] engine: Iterate all shards while seaching for an object
Some checks failed
DCO action / DCO (pull_request) Successful in 1m31s
Vulncheck / Vulncheck (pull_request) Successful in 2m14s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m24s
Build / Build Components (pull_request) Successful in 2m28s
Tests and linters / Lint (pull_request) Successful in 2m59s
Tests and linters / Run gofumpt (pull_request) Successful in 2m55s
Tests and linters / gopls check (pull_request) Successful in 3m13s
Tests and linters / Tests (pull_request) Failing after 3m30s
Tests and linters / Staticcheck (pull_request) Successful in 3m35s
Tests and linters / Tests with -race (pull_request) Failing after 5m5s
Before, when searching for an object, we iterated over shards and stopped
right after we found the object. Currently, we need to iterate over all
shards, because, when the object and its GC mark are stored separately, we
could find the object earlier than its GC mark.

Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
2024-10-08 12:29:09 +03:00
6ccac0a476
[#1403] metabase: Refactor inGraveyardWithKey function
This function was very obfuscated. I hope the newer version is more
clear, but IMHO it keeps being bad because:
- Its name is confusing because it checks both the graveyard and the
  garbage.
- It has no interface. We use that function in several metabase methods,
  it just returns some 'magic' uint8 numbers and has no doc comment, I
  mean it's ridiculous.
- It checks out for 'the node being in incorrect state' for some reason
  but that result isn't used further. I kept a comment about that but it
  has no logic for me.

Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
2024-10-07 16:17:20 +03:00
3f4df881c9
[#1403] engine: Add tests for object deletion on read-only shard
Currently, when an object on some shard is inhumed, the engine places
a tombstone on the same shard. If the target shard is read-only, the
engine fails.

In that case, we want the engine to correctly place a tombstone on
a different shard, ensuring that:
- An object becomes unavailable if a tombstone was placed on a different
  shard. See `TestObjectUnavailableIfTombstoneOnDifferentShard` test.
- GC deletes an object if a tombstone was placed on a different shard.
  See `TestObjectDeletedIfTombstoneOnDifferentShard` test.

Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
2024-10-07 16:16:24 +03:00