Skip to content

fix: propagate iteration errors#42

Merged
rvagg merged 2 commits intomainfrom
rvagg/propagate-iter-errors
Mar 8, 2023
Merged

fix: propagate iteration errors#42
rvagg merged 2 commits intomainfrom
rvagg/propagate-iter-errors

Conversation

@rvagg
Copy link
Copy Markdown
Member

@rvagg rvagg commented Mar 7, 2023

When you try to iterate over a shard where you don't have access to all the blocks, because we don't propagate the actual error we get an overrun error, which doesn't tell you much. This change propagates the error so you have a chance at intuiting what's going on.

If you car extract the wikipedia partial CAR in ipld/go-car#384 prior to this change you get an error:

2023/03/07 22:18:59 bafybeiaysi4s6lnjev27ln5icwm6tueaw2vdykrtjkwiphwekaywqhcjze: iterator overread

with this change you get:

2023/03/07 22:33:22 bafybeiaysi4s6lnjev27ln5icwm6tueaw2vdykrtjkwiphwekaywqhcjze: ipld: could not find bafybeichnleonsnrhdmykteijc2klanhwcrzoek4bzgdkx6amq3gwtj6uq

the first CID is the shard root, the second CID is the first one in the substrate that it tries to load for a complete iteration.

@rvagg rvagg requested review from masih and willscott March 7, 2023 11:38
@rvagg rvagg merged commit a1d0566 into main Mar 8, 2023
@rvagg rvagg deleted the rvagg/propagate-iter-errors branch March 8, 2023 02:47
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.

2 participants