Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revive dead object via control service #2968

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

End-rey
Copy link
Contributor

@End-rey End-rey commented Oct 17, 2024

Closes #1450.

Includes API definition extending, RPC implementation, tests of metabase func.
The command requests server's storage engine to revive object by address. It's
purge all removal marks from all metabases and returns revival statuses.

Signed-off-by: Andrey Butusov <[email protected]>
Support command that revive object by purging all removal marks from all
metabases.

```
$ neofs-cli control object status --endpoint s04.neofs.devenv:8081 -w
services/storage/wallet04.json --object 4yYJV2AyHaJ3fpVimEihAj6NTkwmanbwE7YatJUWBPyM/CYUeRyjfiNXhBMW9XZmdSBJNVLXYBH3gSNQASWTGZX8t
Enter password >
Shard ID: 2wEzFvWsao9yBiDWKjSBfF
	metabase: AVAILABLE
	peapod: path: "/storage/peapod1.db"
$ neofs-cli object delete -r s04.neofs.devenv:8080 -w services/storage/wallet04
.json --cid 4yYJV2AyHaJ3fpVimEihAj6NTkwmanbwE7YatJUWBPyM --oid CYUeRyjfiNXhBMW9XZmdSBJNVLXYBH3gSNQASWTGZX8t
Enter password >
Object CYUeRyjfiNXhBMW9XZmdSBJNVLXYBH3gSNQASWTGZX8t removed successfully.
  ID: C2LrMExCF3FTfQaFYYZfoDGLpsUVLUy156pUpWh72YeN
  CID: 4yYJV2AyHaJ3fpVimEihAj6NTkwmanbwE7YatJUWBPyM
$ neofs-cli control object status --endpoint s04.neofs.devenv:8081 -w
services/storage/wallet04.json --object 4yYJV2AyHaJ3fpVimEihAj6NTkwmanbwE7YatJUWBPyM/CYUeRyjfiNXhBMW9XZmdSBJNVLXYBH3gSNQASWTGZX8t
Enter password >
Shard ID: 2wEzFvWsao9yBiDWKjSBfF
	metabase: AVAILABLE,IN GRAVEYARD
	peapod: path: "/storage/peapod1.db"
$ neofs-cli control object revive --endpoint s04.neofs.devenv:8081 -w
services/storage/wallet04.json --object 4yYJV2AyHaJ3fpVimEihAj6NTkwmanbwE7YatJUWBPyM/CYUeRyjfiNXhBMW9XZmdSBJNVLXYBH3gSNQASWTGZX8t
Enter password >
Shard ID: Vuy2Q8QaPZSuUxDycPxSBC
Revival status: don't revive, err: logical error: object neither in the graveyard nor was marked with GC mark
Shard ID: 2wEzFvWsao9yBiDWKjSBfF
Revival status: successful revival from graveyard, tomb: 4yYJV2AyHaJ3fpVimEihAj6NTkwmanbwE7YatJUWBPyM/C2LrMExCF3FTfQaFYYZfoDGLpsUVLUy156pUpWh72YeN
$ neofs-cli control object status --endpoint s04.neofs.devenv:8081 -w
services/storage/wallet04.json --object 4yYJV2AyHaJ3fpVimEihAj6NTkwmanbwE7YatJUWBPyM/CYUeRyjfiNXhBMW9XZmdSBJNVLXYBH3gSNQASWTGZX8t
Enter password >
Shard ID: 2wEzFvWsao9yBiDWKjSBfF
	metabase: AVAILABLE
	peapod: path: "/storage/peapod1.db"
```

Closes #1450.

Signed-off-by: Andrey Butusov <[email protected]>
@End-rey End-rey force-pushed the 1450-allow-to-revive-dead-object-via-control-service branch from 7399fa6 to 2694957 Compare October 17, 2024 12:27
Copy link

codecov bot commented Oct 17, 2024

Codecov Report

Attention: Patch coverage is 9.72222% with 455 lines in your changes missing coverage. Please review.

Project coverage is 23.34%. Comparing base (c4bdae1) to head (2694957).

Files with missing lines Patch % Lines
pkg/services/control/service.pb.go 4.31% 244 Missing ⚠️
pkg/services/control/service_neofs.pb.go 0.00% 75 Missing ⚠️
cmd/neofs-cli/modules/control/object_revive.go 0.00% 45 Missing ⚠️
pkg/local_object_storage/metabase/revive.go 59.37% 15 Missing and 11 partials ⚠️
pkg/services/control/server/object_revive.go 0.00% 25 Missing ⚠️
pkg/local_object_storage/engine/revive.go 0.00% 13 Missing ⚠️
pkg/services/control/rpc.go 0.00% 9 Missing ⚠️
pkg/local_object_storage/shard/revive.go 0.00% 8 Missing ⚠️
pkg/services/control/convert.go 0.00% 8 Missing ⚠️
cmd/neofs-cli/modules/control/object.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2968      +/-   ##
==========================================
- Coverage   23.47%   23.34%   -0.14%     
==========================================
  Files         780      785       +5     
  Lines       46655    47081     +426     
==========================================
+ Hits        10953    10991      +38     
- Misses      34833    35210     +377     
- Partials      869      880      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to revive dead object via control service
1 participant