fix: with etcd, the other node claims the VIP only when the lease shows -1 (keel#126) #127
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Keel-Linux/keel!127
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/vip-lease-last-second"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #126.
Cause
This is a real overlap in the product, not an artifact of the sampler.
etcd gives a lease's time to live in whole seconds, rounded down. A lease with less than 1 s left shows
ttl 0, and a keep-alive in that second keeps it (seen on etcd 3.5.16:ttl 0, thenkeepalived with TTL(3), thenttl 2).Controller.fail_overandvippromote.gone_leasetookttl <= 0as a lease that is gone.In run 37892870474 (
etcd-auth / trixie), A was cut off for 10.1 s from about t = ...312.6 to ...322.8. Its lease expired about 20 s after its last keep-alive before the cut, at about ...330.5. After the heal, A's renewals failed for some seconds more (loaded runner, round trips to 2.1 s). Its first confirmed renewal came in the last second of the lease. B read 0 in that second and claimed. The sampler read both A and B as holders at t = 1791527330.62 and 1791527330.83, within the same millisecond each time. A dropped the VIP when it took B's newer claim from the counter (1 s turn). The fake etcd of the unit tests gave a live lease 1 s at least (max(1, ...)), so this case never ran.Fix
vipetcd.gone(ttl): only -1 is gone. The failover and promote use it.Netns assertion
tests/vip_overlap.pyis a process of its own. It reads every node's/proc/PID/net/if_inet6in a tight loop (2 ms), in a palindromic order (A B C C B A, the first node turned each round), with CLOCK_MONOTONIC. It reports an overlap only when it can prove one at one instant, and a handover is never one.vip / trixieandetcd-auth / trixiefail on any such overlap. The 200 ms sampler stays.Version 0.23.9.