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

rewrite sync manager #4599

Merged
merged 26 commits into from
Nov 6, 2020
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5d34b7d
rewrite sync manager
vyzo Oct 26, 2020
af53b72
fix typo
vyzo Oct 26, 2020
f26385d
use weight as the sync target selector
vyzo Oct 26, 2020
c0a039e
fix logging
vyzo Oct 26, 2020
f055681
fix test
vyzo Oct 26, 2020
2fd0d43
set BootstrapPeerThreshold to 1, to mimic old code
vyzo Oct 26, 2020
16d2cb6
Add flag to coalesce Tipsets in pending queue
Oct 27, 2020
2b82e5a
Fix tipset coalescing in case of repeated blocks
Oct 27, 2020
ab7a66b
track recently synced tipsets to avoid unnecessary worker spawning
vyzo Oct 27, 2020
fc1ac3e
simplify circular buffer code
vyzo Oct 27, 2020
469666d
limit max active sync workers
vyzo Oct 28, 2020
9ddf7bb
better handling of initial sync
vyzo Oct 28, 2020
188d164
stop the ticker when done with it
vyzo Oct 28, 2020
6266bae
log worker spawning from initial sync deferrals
vyzo Oct 28, 2020
ba25126
track last few worker states for debug purposes
vyzo Oct 28, 2020
e575b5f
Add error if weights are the same
Oct 28, 2020
ad905fc
Expose WorkerID
Oct 28, 2020
a26420f
add missing return for deferrals during initial sync
vyzo Oct 29, 2020
8702ff8
rename initialSync to initialSyncDone
vyzo Oct 29, 2020
a650641
transition out of initial sync only if sync finishes within 15min
vyzo Oct 29, 2020
47830ef
set BootstrapPeerThreshold to 4, add env variable to override
vyzo Oct 29, 2020
57234d8
fix spelling in comment to satisfy linter
vyzo Oct 29, 2020
8d25fd3
set BootstrapPeerThreshold to 1 for tests
vyzo Oct 29, 2020
f6ecff0
check recent syncs in selectSyncTarget/selectDeferredSyncTarget
vyzo Oct 30, 2020
5dcf339
fix sync wait cli
vyzo Oct 30, 2020
d6e2c80
if noone is working pick the last worker in sync wait
vyzo Oct 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
if noone is working pick the last worker in sync wait
  • Loading branch information
vyzo committed Oct 30, 2020
commit d6e2c80608179fa7abc488889fee1478fc0d1493
6 changes: 5 additions & 1 deletion cli/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func SyncWait(ctx context.Context, napi api.FullNode, watch bool) error {
return err
}

working := 0
working := -1
for i, ss := range state.ActiveSyncs {
switch ss.Stage {
case api.StageSyncComplete:
Expand All @@ -284,6 +284,10 @@ func SyncWait(ctx context.Context, napi api.FullNode, watch bool) error {
}
}

if working == -1 {
working = len(state.ActiveSyncs) - 1
}

ss := state.ActiveSyncs[working]
workerID := ss.WorkerID

Expand Down