Revive dead object via control service#2968
Conversation
7399fa6 to
2694957
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2968 +/- ##
==========================================
- Coverage 23.47% 22.89% -0.59%
==========================================
Files 780 785 +5
Lines 46655 58747 +12092
==========================================
+ Hits 10953 13449 +2496
- Misses 34833 44419 +9586
- Partials 869 879 +10 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Andrey Butusov <andrey@nspcc.io>
2694957 to
1e3f1ae
Compare
| } | ||
|
|
||
| var addr oid.Address | ||
| err = addr.DecodeString(request.GetBody().GetObjectAddress()) |
There was a problem hiding this comment.
Why a string representation here? I'd not expect this in a protobuf protocol, you can avoid decoding.
There was a problem hiding this comment.
I don't really understand. Do I need to transmit via bytes? I did the same as the status.
There was a problem hiding this comment.
Whoa. Really unexpected. Well, it's a good reference, but I'd say it's a bug of status implementation. We can either divert here and make it better (it simplifies things) or follow established practice. Not critical then.
There was a problem hiding this comment.
i thought i was expired by some another example for status but i do not find any string implementation (it is strange, cause i am for raw bytes too) so let it be raw bytes then cause we also have it in control API:
neofs-node/pkg/services/control/service.proto
Lines 117 to 119 in 5c5c42c
status can be fixed separately
There was a problem hiding this comment.
Can you please explain where I should use bytes and where string?
For example, here:
neofs-node/pkg/services/control/service.proto
Lines 454 to 456 in 1c78683
I see that
shard_id can also be bytes, as shown here:neofs-node/pkg/services/control/types.proto
Line 123 in f858a81
There was a problem hiding this comment.
i think shard ID is ok to be string cause there is no fixed public rule for bytes -> string conversion (for addresses we know it), but for things from our public API it is ok to be bytes and cli can convert it inside according to SDK
@roman-khimov
There was a problem hiding this comment.
Shard ID can be a string, it's deeply internal to the node, no one knows how to convert it properly into something human-oriented.
1e3f1ae to
4ded500
Compare
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 <andrey@nspcc.io>
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 <andrey@nspcc.io>
4ded500 to
26563d4
Compare
| } | ||
|
|
||
| var addr oid.Address | ||
| err = addr.DecodeString(string(request.GetBody().GetObjectAddress())) |
There was a problem hiding this comment.
Wait, but the idea was exactly to avoid DecodeString.
There was a problem hiding this comment.
But I don't really understand how to avoid it. I did it like drop object, that @carpawell provided as example:
neofs-node/pkg/services/control/service.proto
Lines 123 to 125 in 5567e5f
And I can't find a method to convert bytes to an address.
There was a problem hiding this comment.
Looks like our control API is broken all over the place wrt this problem, so we can just follow the way it currently works and solve the problem for all requests in #2980.
Closes #1450.