Stabilize forced partition elections - #8197
Merged
Amaury Chamayou (achamayou) merged 4 commits intoAug 24, 2026
Merged
Conversation
Allow multiple observed election periods for node-to-node transport to recover, and always remove the temporary partition when the election wait exits. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 84a50e6c-025b-4e67-b701-b7d06d764b21
Copilot started reviewing on behalf of
Amaury Chamayou (achamayou)
August 21, 2026 13:03
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the forced primary election path in the partitions end-to-end test to use a longer, election-derived bound and to ensure iptables isolation rules are always removed via a context manager. This improves resilience to transient node-to-node transport recovery delays following partition healing.
Changes:
- Bound the forced-election wait by
4 * network.observed_election_duration(rather than a fixed multiple of the configured election timeout). - Apply the same bound while waiting for commit synchronization (signature replication) after the new primary is elected.
- Use
with network.partitioner.isolate_node(...)so the temporary partition rules are always dropped when the wait scope exits (success or failure).
Custom instructions used:
.github/skills/testing/SKILL.md
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Eddy Ashton (eddyashton)
approved these changes
Aug 24, 2026
Amaury Chamayou (achamayou)
enabled auto-merge (squash)
August 24, 2026 13:25
Amaury Chamayou (achamayou)
deleted the
achamayou-stabilize-partition-election
branch
August 24, 2026 13:50
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
Why
The
VMSS Virtual Cfailure healed the certificate-renewal partition at11:53:28.006, observed primary unanimity and matching commit levels, and then isolated the current primary from the target node roughly 0.4 seconds later.The target needed the remaining backup's vote, but that follower-to-follower node channel had not recovered from the previous iptables partition. The target repeatedly became a pre-vote candidate without receiving a vote response, then hit the existing 8-second bound.
Commit synchronization proves that nodes agree on replicated state; it does not prove that every pairwise node transport is immediately usable. This is the same class of delayed transport recovery previously addressed in #8132.
Waiting for four observed election periods makes the desired outcome itself the readiness probe and permits multiple pre-vote and reconnection attempts. It does not add delay to successful runs because both waits return immediately when their conditions are met, remains bounded, and does not weaken any assertion. Using the partition as a context manager also prevents leaked iptables rules if either wait fails.
Testing
uvx black --check tests/partitions_test.pyuvx ruff check tests/partitions_test.py