fix(api): resolve pinning failures for erasure-coded chunk#5230
fix(api): resolve pinning failures for erasure-coded chunk#5230gacevicljubisa wants to merge 3 commits intomasterfrom
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.
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.
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.
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):