-
Notifications
You must be signed in to change notification settings - Fork 337
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
perf(puller): reduce historical sync workload #4000
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
istae
changed the title
perf: reduce redundant historical sync workload
perf(puller): reduce redundant historical sync workload
Apr 12, 2023
istae
changed the title
perf(puller): reduce redundant historical sync workload
perf(puller): reduce historical sync workload
Apr 12, 2023
istae
requested review from
a team,
mrekucci,
acha-bill and
aloknerurkar
and removed request for
a team
April 12, 2023 10:40
mrekucci
reviewed
Apr 12, 2023
pkg/puller/puller.go
Outdated
case <-ctx.Done(): | ||
loggerV2.Debug("histSyncWorker context cancelled", "peer_address", peer, "bin", bin, "cursor", cur) | ||
return | ||
case p.activeHistoricalJobs <- struct{}{}: |
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.
Not sure what is the main purpose of the activeHistoricalJobs
channel?
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.
it's to limit the number of sync jobs that are inflight
mrekucci
approved these changes
Apr 13, 2023
aloknerurkar
approved these changes
Apr 17, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
Description
When the neighborhood size is large, node have to sync with many peers that ultimately respond with the same chunks because reserves are identical across neighborhoods. It is wasteful to have to sync with ALL of the neighbors at the SAME time.
So, we can limit the amount of parallel hist sync jobs and that should reduce the intensity of the initial syncing.
Since reserves are identical across neighborhoods (we get the same chunk from different peers), the time to find a stable storage radius does not get affected.
This change also propagates through the network because peers now have to respond to fewer sync requests.
At the end, we still complete historical syncing with every neighbor.
The depthmonitor wake up interval is also increased.
Open API Spec Version Changes (if applicable)
Motivation and Context (Optional)
Related Issue (Optional)
Screenshots (if appropriate):