Skip to content
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

sync2: multipeer: fix edge cases #6447

Open
wants to merge 2 commits into
base: sync2/dbset-conns
Choose a base branch
from

Conversation

ivan4th
Copy link
Contributor

@ivan4th ivan4th commented Nov 11, 2024


Motivation

Split sync could become blocked when there were slow peers. Their
subranges are assigned to other peers, and there were bugs causing
indefinite blocking and panics in these cases. Moreover, after other
peers managed to sync the slow peers' subranges ahead of them, we need
to interrupt syncing against the slow peers as it's no longer needed.

In multipeer sync, when every peer has failed to sync, e.g. due to
temporary connection interruption, we don't need to wait for the full
sync interval, using shorter wait time between retries.

Description

This fixes aforementioned multipeer sync issues, and adds tests.
It also adds sync interval randomization to avoid network load spikes.

Split sync could become blocked when there were slow peers. Their
subranges are assigned to other peers, and there were bugs causing
indefinite blocking and panics in these cases. Moreover, after other
peers managed to sync the slow peers' subranges ahead of them, we need
to interrupt syncing against the slow peers as it's no longer needed.

In multipeer sync, when every peer has failed to sync, e.g. due to
temporary connection interruption, we don't need to wait for the full
sync interval, using shorter wait time between retries.
Copy link

codecov bot commented Nov 11, 2024

Codecov Report

Attention: Patch coverage is 71.59091% with 25 lines in your changes missing coverage. Please review.

Project coverage is 79.9%. Comparing base (9e585e5) to head (042d0d7).

Files with missing lines Patch % Lines
sync2/p2p.go 68.1% 13 Missing and 1 partial ⚠️
sync2/multipeer/multipeer.go 71.4% 4 Missing and 2 partials ⚠️
sync2/multipeer/split_sync.go 78.2% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##           sync2/dbset-conns   #6447     +/-   ##
===================================================
- Coverage               79.9%   79.9%   -0.1%     
===================================================
  Files                    352     352             
  Lines                  46148   46209     +61     
===================================================
+ Hits                   36894   36928     +34     
- Misses                  7162    7193     +31     
+ Partials                2092    2088      -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant