Skip to content

[SUPPORT] Fix/Helper object broadcasting#2008

Merged
fyrchik merged 4 commits intonspcc-dev:support/v0.34from
carpawell:fix/lock-objects-broadcasting
Nov 8, 2022
Merged

[SUPPORT] Fix/Helper object broadcasting#2008
fyrchik merged 4 commits intonspcc-dev:support/v0.34from
carpawell:fix/lock-objects-broadcasting

Conversation

@carpawell
Copy link
Member

@carpawell carpawell commented Nov 1, 2022

Closes #1972.

Includes:

  1. CLI object lock's lifetime flag fix;
  2. Changing broadcasting logic: a node does not save object relations if it is not in the object's container. I did not find any usage of that, but it disallows correct object handling: putting a TS record to a storage of a node that does not belong to the container skips any lock object checks (it just does not have any helper objects of the container) and does not have any reasons. @fyrchik, @cthulhu-rider, please, double-check that.

@carpawell carpawell requested a review from acid-ant November 1, 2022 17:55
@carpawell carpawell requested a review from alexvanin as a code owner November 1, 2022 17:55
@carpawell carpawell self-assigned this Nov 1, 2022
@acid-ant
Copy link
Contributor

acid-ant commented Nov 2, 2022

I've tested scenario from #1973 with your changes and it seems to fix it. But when I tried to delete locked object from node2, which stored on node1, in error message we have only status code which indicates that object locked instead of human readable message:

@:~/workspace/neofs-dev-env$ neofs-cli --rpc-endpoint s02.neofs.devenv:8080 --wallet wallets/wallet.json object delete --cid 3kAdxaa5zPXFoXM1vkC6NhFzDwoBYPUY4r6Sw1YtRXuo --oid 5fvMyXMThjGckucKzZuADkeGSmMcoPn8eepXZdL6f4bZ
Enter password > 
rpc error: remove object via client: status: code = 1024 message = incomplete object PUT by placement: could not close object stream: (*putsvc.remoteTarget) could not put object to [/dns4/s01.neofs.devenv/tcp/8080]: write object via client: status: code = 1024 message = incomplete object PUT by placement: could not close object stream: could not delete objects from tombstone locally: status: code = 2050

@carpawell carpawell changed the title Fix/Helper object broadcasting [SUPPORT] Fix/Helper object broadcasting Nov 2, 2022
fyrchik
fyrchik previously approved these changes Nov 7, 2022
contentGot, err := v.ValidateContent(obj)
require.NoError(t, err) // all good

require.EqualValues(t, []oid.ID{id}, contentGot.Objects())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also check type?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
That part of the code was refactored incorrectly.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Do not use node's local storage if it is clear that an object will be
removed anyway as a redundant. It requires moving the changing local storage
logic from the validation step to the local target implementation.
It allows performing any relations checks (e.g. object locking) only if a
node is considered as a valid container member and is expected to store
(stored previously) all the helper objects (e.g. `LOCK`, `TOMBSTONE`, etc).

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Includes:
1. Unused func removal;
2. Err check of the `Sign` method.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
@codecov
Copy link

codecov bot commented Nov 7, 2022

Codecov Report

Merging #2008 (659caa3) into support/v0.34 (d2cce62) will increase coverage by 0.02%.
The diff coverage is 34.00%.

@@                Coverage Diff                @@
##           support/v0.34    #2008      +/-   ##
=================================================
+ Coverage          30.54%   30.56%   +0.02%     
=================================================
  Files                380      380              
  Lines              27800    27793       -7     
=================================================
+ Hits                8492     8496       +4     
+ Misses             18606    18596      -10     
+ Partials             702      701       -1     
Impacted Files Coverage Δ
cmd/neofs-node/object.go 0.00% <0.00%> (ø)
pkg/core/object/fmt.go 67.54% <51.51%> (+6.68%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@fyrchik fyrchik merged commit 3eb2ac9 into nspcc-dev:support/v0.34 Nov 8, 2022
@carpawell carpawell deleted the fix/lock-objects-broadcasting branch November 8, 2022 13:28
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.

3 participants