-
Notifications
You must be signed in to change notification settings - Fork 18
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(storage): insure no-dupes on protocol race when pre-filling dupes #277
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #277 +/- ##
==========================================
+ Coverage 71.18% 73.07% +1.88%
==========================================
Files 69 70 +1
Lines 6043 6651 +608
==========================================
+ Hits 4302 4860 +558
- Misses 1496 1547 +51
+ Partials 245 244 -1
|
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 was trying to check this on bafybeiezxzqimpb3vdxljgd5pxlgc3kwlalbzm5am27d2ehjiguyclgf7e but it's not operating like it did yesterday, a bitswap peer has probably disappeared in the meantime so it just fails on bad CAR from eipfs
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.
oh, wait, there's CI errors, malformed MIME header: missing colon: "0"
, are we hitting a problem with our chunked encoding error signal perhaps?
8c6cb9c
to
b171926
Compare
@rvagg ok, I think I've fixed, this, but I'll admit the fix was quite confusing, and I need your review. Essentially, during an HTTP + bitswap traversal:
The solution is at step number 5, if it's not in the preload store, we try the main store as a backup. |
I added another commit with more explanatory docs in the preloader to clear up confusion (hopefully) for how that tricky flow works in |
Goals
fix #276
Implementation
Basically, before we insert dups on dups=y, we need to make sure the CAR file we're verifying against has no duplicate puts due to protocol racing.
So, we simply don't add duplicate blocks to verification stream (that in turn inserts duplicates).
Honestly, this is all way too complicated. But it works.