-
Notifications
You must be signed in to change notification settings - Fork 213
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
feat: Improve content propagation in sync #1480
Conversation
fe9dc20
to
a6773be
Compare
|
upon receiving the request you can only start it right away if the provider is connected. what we need to do is, when a provider has capacity (which includes ofc when it first connects) to get the next hash if provides eagerly, so changes there are a bit more involved. My plan was to store this in the In this way we combine needing to have delays on retries and eager downloads from known providers. I know you would like to consider delays per (hash, peer) but I would wait until we see if this is necessary since that's more overhead than what's potentially necessary to effectively get a download. Also, I think it's a reasonable option to limit the PR up to where we define the peer priority and handle eager downloads in another one since what's in here is a good improvement per se already. This way you are not blocked by the changes of the downloader in the meantime |
I added two commits:
With these two changes, tests should now pass! And all artificial delays for content downloads in the happy case are gone now. I think this is ready for review now. Noted some other things we might do to improve sync, but those should go into new PRs. |
32eff14
to
6f5ad3b
Compare
6f5ad3b
to
dfba9bb
Compare
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.
just starting here
49e2d40
to
6f67690
Compare
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.
Looks good to me! I can't vouch more for the sync related code but gossip and downloads look generally good. Comments are minor
I do not know why occured now, but without this change the `sync_full_basic` test hangs for me. With this change, it passes. Also is a bit cleaner architecture this way.
6f67690
to
d6ac046
Compare
Thanks for the review. Addressed the comments, let's see what CI says :) |
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.
lgtm!
…ases (#1584) ## Description We weren't removing the hash of a request that was scheduled, became ready but couldn't be executed. This caused getting the next hash for a provider to pop a hash no longer necessary. I added an invariant check for the provider map and it seems to be we missed a couple removals in #1480 so this fixes removal in cancellation as well ## Notes & open questions one small change, seemingly unrelated, is that the `debug_assert` now uses the debug version of the hash instead of display. This is because throughout the file we log the kind in debug, which in turn uses the debug impl for the hash. This difference made it a bit harder to follow the logs because the printed hash didn't match those in the rest of the logs. The change makes this consistent ## Change checklist - [x] Self-review. - [ ] Documentation updates if relevant. - [x] Tests if relevant.
Description
This improves content propagation for document sync by implementing the following features.
Notes & open questions
Change checklist