fix: a MariaDB holder whose lease is in doubt acknowledges no write (keel#195) #197
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!197
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/mariadb-fence-on-lease-doubt-195"
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?
Fixes #195. Stacked on #194 → #191 → #190 → #189 → #187: merge those first.
Rehearsal 2 of the cross-site LNMP test (keel 0.23.38): on the cut MariaDB holder, a write that waited for the replica returned OK when the dump thread to the cut replica ended, 15.1 s after the cut (
wait_no_slave = OFF,tcp_retries2 = 5), before the release (15 s from the last confirmed renewal). The VIP had left 1.7 s before, so by luck the OK did not reach the client; a client on the local socket gets it. The fence came from the watch, 35 s after the VIP left, because the release on a cut holder writes no state.What changes:
keel vip controlmarks, through its root half (bridge opdoubt), the doubt of its own lease once the last renewal that the majority confirmed is 6 s old (DOUBT):/var/lib/keel/vip/<vip>.unconfirmed. It keeps the VIP until the release, as before, and removes the mark at the next confirmed renewal; a mark an earlier controller left goes at the first renewal the new one confirms; a controller that starts cut off doubts too; a mark goes with the claim. The mark is best effort and never stops the release. The root half accepts it for the node's own VIP only.keel database followfences a MariaDB holder in doubt (read_only and the connections ended, #186/#193) and leaves the role;keel database watchfollows a writable holder in doubt and leaves a fenced one. PostgreSQL is not changed: its commits wait.wait_no_slave = ONis not used: a new primary has no replica yet, and its first write would wait the whole timeout.docs/vip.md(the holder's doubt),docs/replication.md(why the fence starts at the doubt; the 30 s timeout now justified by the measured fence time; and a correction: the firewall accepts 3306 on wg0 from every member, as for every mesh port).Tests: controller (mark after DOUBT, cleared at the next renewal, stale mark cleared, restart cut off, mark goes with the claim, a mark that cannot be written never stops the release), bridge (mark, clear, refusal of what is not this node's VIP), follow and watch. The new tests fail without the fix (checked by the review).
Real nodes, rehearsal 3 (lnmp 19.0-2 with this keel installed by hand, BR1 + BR2): cut to read only 8.8 s (base) and 6.1 s (netem 250 ms); the dump thread ended at the fence, not before; 0 of 6908 and 0 of 13337 acknowledged ids lost with a local socket writer and a VIP writer; 0 spurious marks in 2 quiet windows of 10 min (base and netem). Raw notes stay with the evidence of the release test.
keel 0.23.39.