Repository navigation
fix: only the other member of the pair gates a promote; the others are told after (keel#137) - #141
Open
marcos-mendez wants to merge 1 commit into
Open
marcos-mendez wants to merge 1 commit into
marcos-mendez wants to merge 1 commit into
Conversation
4 tasks
marcos-mendez
force-pushed
the
fix/promote-announce-in-background
branch
from
October 10, 2026 18:19
9988ec4 to
22ab394
Compare
…e told after (keel#137) In cloud simple, one member outside the pair that was down (web-2) made every keel vip promote wait two 10 s timeouts on it, for its epoch and for the announcement: a planned promote took about 21 s on a real pair, and the write gap went up to 11 s. The same 10 s were the new primary's follow waiting for the VIP on wg0 (keel#138's 10 s). Before etcd, the promote now asks the other member of the pair alone for its epoch, asks it to release, and tells it the claim; each is waited for in full (the safety rule of keel#108: nothing fences a live old primary without etcd). The VIP is carried once that member took the claim; when it refuses or does not answer, the claim is released and the promote exits non-zero. The members outside the pair are told after, in a thread that is not a daemon, and what each said is logged. With --old-primary-gone every peer is asked and told and the claim is carried on a majority of those that answer, as before. With etcd the peers are told in the background too. A replica that holds the primary's claim asks the release at the next epoch at once; it asks the epoch only when the primary refuses that as stale, then asks the release again. So a planned promote has two round trips with the other member, not three (3.44 s at 250 ms with three). Tests: a member outside the pair down does not hold up the promote, and learns the claim after; no epoch is asked that is known here, and a stale release asks it; the other member refusing the claim stops it; a first promote with the other member down is refused, and taken with --old-primary-gone. New job vip-simple / trixie: every spec in cloud simple, C (outside the pair) cut off, a planned promote takes the VIP in less than 3 s at 250 ms and 2 % loss, and tests/vip_overlap.py proves no two nodes carry it at one instant.
marcos-mendez
force-pushed
the
fix/promote-announce-in-background
branch
from
October 10, 2026 18:19
22ab394 to
191f4c4
Compare
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.
Fixes #137. Stacked on #136 (both bump
debian/changelog); its base is #136's branch.Problem
In cloud simple, one member outside the pair that was down (web-2) made every
keel vip promotewait two 10 s timeouts on it: once for its epoch, once for the announcement. On a real pair a planned promote took about 21 s, and the write gap went up to 11 s. The new primary's follow waits for the VIP onwg0, so it also waited those 10 s; this is the 10 s of #138.Change
Before etcd (
keel/mesh/vippromote.py,promoted):in_background), and what each said is logged.A replica that holds the primary's claim asks the release at the next epoch at once, and asks the epoch only when the primary refuses that as stale (then the release again): two round trips with the other member, not three. With three, the first CI run measured 3.44 s.
With
--old-primary-gone(promoted_by_all), every peer is asked and told, and the claim is carried on a majority of those that answer, as before. With etcd, the peers are told in the background too.Also:
keel/mesh/vipnode.py(epochsandannouncetakeonly),docs/vip.md,debian/changelog0.23.15.Tests
tests/test_mesh_vipmove.py:--old-primary-gone.tests/vip_helpers.pyturns the background off for the older tests, which read the peers right after a promote.vip-simple / trixie(tests/test_vip_simple_netns.py): every spec in cloud simple, C (outside the pair) cut off. A planned promote must take the VIP in less than 3 s at 250 ms and 2 % loss, andtests/vip_overlap.pymust prove that no two nodes carry it at one instant.Measured (
vip-simple / trixie, 191f4c4, 250 ms ±25 ms, 2 % loss)Planned promote with C (outside the pair) cut off: 1.9 s (keel 0.23.13 on real nodes: about 21 s). No two nodes carried the VIP at one instant.
CI record
Green at 191f4c4 at the first run, no rerun. The first head (9988ec4) failed
vip-simple / trixie(3.44 s, three round trips, fixed by the change above),tests / coverage(an older test,test_no_peer_answering_is_no_majority, expected the majority message; updated), and the coverage job'stest_mesh_netnstimed out once.Test plan