-
Notifications
You must be signed in to change notification settings - Fork 378
fix(api): resolve pinning failures for erasure-coded chunk #5230
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
base: master
Are you sure you want to change the base?
Conversation
TestingSteps to Reproduce the Issue:
Example Download Command:Verification:After applying this fix, the same hash should be pinable via: |
zelig
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think this should go in . we need:
- to explain what was the issue
- to explain why the issue does not appear now
- why redundancy.DefaultLevel is used
| return | ||
| } | ||
|
|
||
| getter := s.storer.Download(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this does what we need.
What caused the problem and how did you fix it?
Honestly, I dont this replicas (as opposed to parities) should be pinned at all, cos they are the same as the root chunk. When it comes to repair it should just upload the replicas too to swarm .
Also it is very suspicious that redundancy.DefaultLevel is used here. You know the level of a pinned file we can assume, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idea behind this PR was to addresses just specific comment in issue #5228 .
Thanks for clarifying that replicas shouldn't be pinned.
I used redundancy.DefaultLevel as an assumption, and it is much used all over the codebase. Recently I created new issue related to the use of redundancy.DefaultLevel and inconsistent Swarm-Redundancy-Level header.
I wasn't aware we can extract the redundancy level from the pinned file.
Can you suggest me the flow, how pinning should be handled if route chunk can not be found?
Also, how we can repair by uploading the replicas too to swarm?
Checklist
Description
This change ensures that erasure-coded content can be properly pinned, maintaining data availability and integrity within the Swarm network. Issue is desribed in this comment.
This basic getter doesn't understand the replica structure of erasure-coded chunks, causing the traversal to fail when trying to pin such content.
Changed the getter to use
replicas.NewGetterwhich is specifically designed to handle erasure-coded chunks:Open API Spec Version Changes (if applicable)
Motivation and Context (Optional)
Related Issue (Optional)
Screenshots (if appropriate):