feat: avoid clustered restarts during upgrades#49
Merged
Conversation
Prevents clustered restarts when a new release is published by spreading node upgrades evenly across a 24-hour window instead of 1 hour. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When an upgrade is pending, the monitor task now sleeps for precisely the remaining rollout delay rather than waiting for the next check interval tick. This eliminates restart clustering caused by quantization to the check interval. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Pre-release versions (alpha, beta, rc) should not be published to crates.io. Also removes publish-crate from the release job dependency chain so pre-release GitHub releases aren't blocked. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Reduces upgrade-induced restart clustering by widening the staged rollout window and aligning sleep timing with each node’s scheduled upgrade time; also updates the release workflow to skip crates.io publishing for prereleases.
Changes:
- Increase default staged rollout window from 1 hour to 24 hours.
- When an upgrade is pending, sleep until the exact remaining rollout delay rather than the next check interval tick.
- Skip crates.io publish for prerelease tags in the GitHub Actions release workflow.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/node.rs |
Adjusts upgrade-monitor loop to sleep until scheduled upgrade time to avoid quantization/clustering. |
src/config.rs |
Changes default staged rollout window from 1h to 24h. |
.github/workflows/release.yml |
Skips crates.io publishing for prereleases and adjusts job dependencies for release creation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add backoff when rollout delay has elapsed but upgrade failed, to prevent a tight retry loop on Duration::ZERO - Wrap upgrade sleep in tokio::select! with shutdown.cancelled() so shutdown can interrupt long rollout delay sleeps - Restore publish-crate dependency on release job with conditional logic: release proceeds if publish-crate succeeds or was skipped (pre-release), but blocks if it fails (stable) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
mickvandijke
approved these changes
Mar 30, 2026
mickvandijke
added a commit
that referenced
this pull request
Apr 1, 2026
Add unit and e2e tests covering the remaining Section 18 scenarios: Unit tests (32 new): - Quorum: #4 fail→abandoned, #16 timeout→inconclusive, #27 single-round dual-evidence, #28 dynamic threshold undersized, #33 batched per-key, #34 partial response unresolved, #42 quorum-derived paid-list auth - Admission: #5 unauthorized peer, #7 out-of-range rejected - Config: #18 invalid config rejected, #26 dynamic paid threshold - Scheduling: #8 dedup safety, #8 replica/paid collapse - Neighbor sync: #35 round-robin cooldown skip, #36 cycle completion, #38 snapshot stability mid-join, #39 unreachable removal + slot fill, #40 cooldown peer removed, #41 cycle termination guarantee, consecutive rounds, cycle preserves sync times - Pruning: #50 hysteresis prevents premature delete, #51 timestamp reset on heal, #52 paid/record timestamps independent, #23 entry removal - Audit: #19/#53 partial failure mixed responsibility, #54 all pass, #55 empty failure discard, #56 repair opportunity filter, response count validation, digest uses full record bytes - Types: #13 bootstrap drain, repair opportunity edge cases, terminal state variants - Bootstrap claims: #46 first-seen recorded, #49 cleared on normal E2e tests (4 new): - #2 fresh offer with empty PoP rejected - #5/#37 neighbor sync request returns response - #11 audit challenge multi-key (present + absent) - Fetch not-found for non-existent key Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
mickvandijke
added a commit
that referenced
this pull request
Apr 1, 2026
Add unit and e2e tests covering the remaining Section 18 scenarios: Unit tests (32 new): - Quorum: #4 fail→abandoned, #16 timeout→inconclusive, #27 single-round dual-evidence, #28 dynamic threshold undersized, #33 batched per-key, #34 partial response unresolved, #42 quorum-derived paid-list auth - Admission: #5 unauthorized peer, #7 out-of-range rejected - Config: #18 invalid config rejected, #26 dynamic paid threshold - Scheduling: #8 dedup safety, #8 replica/paid collapse - Neighbor sync: #35 round-robin cooldown skip, #36 cycle completion, #38 snapshot stability mid-join, #39 unreachable removal + slot fill, #40 cooldown peer removed, #41 cycle termination guarantee, consecutive rounds, cycle preserves sync times - Pruning: #50 hysteresis prevents premature delete, #51 timestamp reset on heal, #52 paid/record timestamps independent, #23 entry removal - Audit: #19/#53 partial failure mixed responsibility, #54 all pass, #55 empty failure discard, #56 repair opportunity filter, response count validation, digest uses full record bytes - Types: #13 bootstrap drain, repair opportunity edge cases, terminal state variants - Bootstrap claims: #46 first-seen recorded, #49 cleared on normal E2e tests (4 new): - #2 fresh offer with empty PoP rejected - #5/#37 neighbor sync request returns response - #11 audit challenge multi-key (present + absent) - Fetch not-found for non-existent key Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or 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
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.
Summary
Test plan
Test results
Auto-Upgrade Test Results: DEV-01
All 91 nodes (90 regular + 1 genesis) successfully upgraded from v0.7.0 to v0.7.10-rc.1.
Key findings:
🤖 Generated with Claude Code