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 9 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.8%. Comparing base (0914f1f) to head (4ac694b).

✅ All tests successful. No failed tests found.

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.8%   -0.1%     
===================================================
  Files                    352     352             
  Lines                  46436   46497     +61     
===================================================
+ Hits                   37108   37145     +37     
- Misses                  7223    7249     +26     
+ Partials                2105    2103      -2     

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

ivan4th and others added 4 commits November 21, 2024 14:59
## Motivation

Most of the time, there are some nodes that already joined the P2P
network but didn't complete their initialization yet, and thus
attempts to e.g. fetch blobs to them end up in stream setup errors
(protocol not supported).
Additionally, during initial phases of `syncv2` testing, we're going
to have a limited number of nodes supporting `sync/2` protocol, and
when choosing peers for `syncv2`, we must only include these peers.



Co-authored-by: Ivan Shvedunov <[email protected]>
@ivan4th ivan4th mentioned this pull request Nov 25, 2024
35 tasks
dependabot bot and others added 3 commits November 26, 2024 08:19
## Motivation

`SyncedTable` has a tiny cache for query strings to avoid heap-intensive query formatting operations (AST->SQL string) upon each SQL query being run.
The cached query string map was not protected by a mutex.
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