Repository navigation
fix: keel vip promote --old-primary-gone waits on the old primary 1.5 s at most (keel#108) - #121
Merged
Merged
Conversation
marcos-mendez
force-pushed
the
fix/promote-old-primary-gone-bounded
branch
from
October 9, 2026 05:04
7ac9f36 to
94bae41
Compare
This was referenced Oct 9, 2026
…primary 1.5 s at most (keel#108) With the old primary dead, keel vip promote --old-primary-gone took 30.5 s on a real pair: it waited three times for the members' channel's 10 s timeout, for the epoch, the release and the announcement. With --old-primary-gone and etcd formed, the old primary's lease fences it. Each ask of it (the release, the announcement) now runs in a thread of its own and waits at most 1.5 s (vipnode.GONE_BOUND); the other peers are not held up. The promote still waits for the old primary's lease to go and never revokes it, as decision 0049 requires. The ask goes on after the bound, in a thread that is not a daemon, and the promote waits for it before it returns (vipnode.finished), so a slow live old primary still gets the release and the claim. Without etcd nothing fences a live old primary: no lease, no lifetime on its address. A live old primary slower than the bound would keep the VIP and stay writable beside the new one. So without etcd nothing is bounded, as before. docs/vip.md, the help of both commands and the docstring of commands.promote_vip say that, without etcd, an old primary that is alive but cannot be reached stays writable until it learns the newer claim. Tests: without etcd, a slow old primary still releases first; with etcd, a hung old primary costs the bound and the late asks are joined; an old primary that answers after the bound still drops the VIP. In mariadb / trixie the crash case writes at the VIP from C every 0.1 s and reports the unplanned write downtime, its parts and the acknowledged rows lost.
marcos-mendez
force-pushed
the
fix/promote-old-primary-gone-bounded
branch
from
October 9, 2026 05:50
94bae41 to
44a4c68
Compare
This was referenced Oct 9, 2026
Closed
Open
4 tasks
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 #108 (finding B7 of Keel-Linux/handbook#60, again in the 0.23.7 rollout, Keel-Linux/handbook#62).
Problem
keel vip promote --old-primary-gonetook 30.5 s with the old primary dead: three serial waits for the members' channel's 10 s timeout (the epoch, the release, the announcement).Change (after the safety review)
keel/mesh/vipnode.py,bounded,GONE_BOUND); the other peers are not held up. The promote still waits for the lease to go and never revokes it (decision 0049). The ask goes on after the bound, in a thread that is not a daemon, and the promote waits for it before it returns (vipnode.finished), so a slow live old primary still gets the release and the claim.docs/vip.md, the help ofkeel vip promoteandkeel database promote, and the docstring ofcommands.promote_vipsay that, without etcd, an old primary that is alive but cannot be reached stays writable until it learns the newer claim.debian/changelog0.23.8.Tests
tests/mariadb_netns.py: the crash case writes at the VIP from C every 0.1 s (after the replica is connected and semi-synchronous) and reports the write downtime, its parts and the acknowledged rows lost.Measured (
mariadb / trixie, etcd, 250 ms ±25 ms, 2 % loss)Each ask of the dead old primary: 1.5 s (
no answer within 1.5 s, nevertimed out). With etcd the claim waits for the old primary's lease (TTL 20 s, 0049); #122 removes the lag after the VIP lands. 0 acknowledged rows lost.CI record
Green at 44a4c68.
vip / trixiefailed once atg_promote_b(etcdctl get: context deadline exceeded, the same failure as main's run 37833124848); I reran that job once (run 37890526886): green. Earlier head 94bae41:mesh / trixiefailed once intest_mesh_channel(TLS EOF), rerun once: green.