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

Fix/Unwrap incomplete object put errors #2126

Closed
wants to merge 1 commit into from
Closed

Fix/Unwrap incomplete object put errors #2126

wants to merge 1 commit into from

Conversation

carpawell
Copy link
Member

@carpawell carpawell commented Dec 1, 2022

Closes #2092.

Before:

Store lock object in NeoFS: client failure: status: code = 1024 message = incomplete object PUT by placement: could not close object stream: (*putsvc.remoteTarget) could not put object to [/dns4/s02.neofs.devenv/tcp/8080]: write object via client: status: code = 1024 message = incomplete object PUT by placement: could not close object stream: could not lock object from lock objects locally: status: code = 2051
...
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/s02.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: lock object removal
...
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

After:

Store lock object in NeoFS: client failure: status: code = 2051 message = locking non-regular object is forbidden
...
rpc error: remove object via client: status: code = 1024 message = lock object removal
...
rpc error: remove object via client: status: code = 2050 message = object is locked

Not sure if we want to lose error chain but that is how unwrapping (looking for API status errors) works in the current code base.

@sami-nspcc
Copy link

I have recieved a notification of a new pull request. I am starting the build of images and binaries for further testing. Build number is 3763

@codecov
Copy link

codecov bot commented Dec 1, 2022

Codecov Report

Merging #2126 (49074a0) into master (42554a9) will decrease coverage by 0.25%.
The diff coverage is n/a.

❗ Current head 49074a0 differs from pull request most recent head 4c88582. Consider uploading reports for the commit 4c88582 to get more accurate results

@@            Coverage Diff             @@
##           master    #2126      +/-   ##
==========================================
- Coverage   30.78%   30.53%   -0.26%     
==========================================
  Files         382      381       -1     
  Lines       28056    28003      -53     
==========================================
- Hits         8637     8550      -87     
- Misses      18687    18721      +34     
  Partials      732      732              
Impacted Files Coverage Δ
pkg/local_object_storage/writecache/get.go 0.00% <0.00%> (-75.87%) ⬇️
pkg/local_object_storage/writecache/init.go 45.00% <0.00%> (-48.55%) ⬇️
..._object_storage/blobstor/blobovniczatree/exists.go 77.77% <0.00%> (-6.23%) ⬇️
...object_storage/blobstor/blobovniczatree/control.go 68.49% <0.00%> (-5.48%) ⬇️
cmd/neofs-node/morph.go 0.00% <0.00%> (ø)
pkg/morph/client/notary.go 0.00% <0.00%> (ø)
pkg/local_object_storage/writecache/options.go 56.09% <0.00%> (ø)
pkg/local_object_storage/blobovnicza/exists.go
pkg/local_object_storage/writecache/storage.go 27.14% <0.00%> (+0.75%) ⬆️
pkg/local_object_storage/blobstor/exists.go 76.47% <0.00%> (+14.56%) ⬆️

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

@sami-nspcc
Copy link

I am running integration tests

@sami-nspcc
Copy link

Test run is finished. Please download the tarball from link. Untar and use allure open to watch the report

@@ -115,6 +115,10 @@ func (x errIncompletePut) Error() string {
return commonMsg
}

func (x errIncompletePut) Unwrap() error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you give an example of what message is expected now? Is it still obvious that there was some error on others node.

Copy link
Member Author

@carpawell carpawell Dec 5, 2022

Choose a reason for hiding this comment

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

With that PR error messages would be just the deepest error because the current error messaging is designed to be so

I agree that keeping the chain could be a good error context and that is why im not sure about the PR. The problem that PR solves is described in the linked issue: any SDK error that has not been converted to its V2 form does not produce a text message (wrapping an SDK error by an error that does not have Unwrap method leads to calling Error method without conversion to a V2 struct => no error message). I did not like such a solution but here we are.

If our desire to save error chain in an "incomplete" context is really strong, I may suggest using init() in SDK for predefined errors that fills all error messages before their usage. Another solution could be introducing a new "IncompleteObjectPut" API error that wraps any error and has a detailed description of error numbers and reasons\

/cc @cthulhu-rider

Copy link
Contributor

Choose a reason for hiding this comment

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

For now I don't mind

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

I have recieved a notification of a new pull request. I am starting the build of images and binaries for further testing. Build number is 3770

@sami-nspcc
Copy link

I am running integration tests

@sami-nspcc
Copy link

Test run is finished. Please download the tarball from link. Untar and use allure open to watch the report

@carpawell
Copy link
Member Author

Closing this in favor of nspcc-dev/neofs-sdk-go#369.

@carpawell carpawell closed this Dec 8, 2022
@carpawell carpawell deleted the fix/incomplete-put-error-msg branch December 8, 2022 16:43
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.

Lock related errors in wrapped erorrs throws error code without message
5 participants