fix: the VIP claim's transaction is tried again, its own commit found first (keel#135) #136
Open
marcos-mendez wants to merge 1 commit from
fix/claim-txn-bounded-retry into main
pull from: fix/claim-txn-bounded-retry
merge into: Keel-Linux:main
Keel-Linux:main
Keel-Linux:fix/ci-flakes-177
Keel-Linux:fix/etcd-stalled-peer-stream-167
Keel-Linux:fix/155-minor-items
Keel-Linux:fix/vip-gone-note-in-state-dir-178
Keel-Linux:feat/images-key-verifiers
Keel-Linux:fix/pg-start-fenced-156
Keel-Linux:fix/vip-rides-out-election-167-168
Keel-Linux:fix/vip-lock-no-path-trigger-164
Keel-Linux:fix/pg-reseed-clears-vip-fence-166
Keel-Linux:fix/pg-promote-follow-before-join-169
Keel-Linux:fix/pg-expired-lease-alone-165
Keel-Linux:fix/vip-learn-without-etcd
Keel-Linux:fix/pg-fenced-holder-writable
Keel-Linux:fix/pg-reseed-cluster-unit
Keel-Linux:feat/postgres-pair-failover
Keel-Linux:docs/signing-roles-0055
Keel-Linux:test/write-resume-bound-5s
Keel-Linux:feat/postgres-pair-converge
Keel-Linux:feat/postgres-pair
Keel-Linux:fix/planned-promote-quiesce
Keel-Linux:fix/vip-restart-renewal
Keel-Linux:feat/mesh-keepalive
Keel-Linux:fix/promote-announce-in-background
Keel-Linux:fix/overlay-mtu-live
Keel-Linux:feat/container-template-guard
Keel-Linux:test/flaky-vip-upgrade-epoch-133
Keel-Linux:fix/peer-added-live
Keel-Linux:test/flaky-mariadb-cert-ask-131
Keel-Linux:test/divergence-record-clock-second
Keel-Linux:test/flaky-netns-94
Keel-Linux:fix/overlay-mtu-119
Keel-Linux:test/mariadb-cloud-simple-crash
Keel-Linux:fix/follow-writable-when-the-vip-lands
Keel-Linux:fix/vip-lease-last-second
Keel-Linux:fix/mariadb-crashed-primary-keel94
Keel-Linux:fix/promote-old-primary-gone-bounded
Keel-Linux:fix/joiner-full-mesh-live-peers
Keel-Linux:fix/flaky-netns-keel94
Keel-Linux:fix/overlay-live-peers
Keel-Linux:fix/root-holder-for-every-member
Keel-Linux:fix/old-primary-read-only-until-proven
Keel-Linux:feat/invite-in-the-inviters-region
Keel-Linux:fix/version-from-metadata
Keel-Linux:fix/members-channel-thread-switch
Keel-Linux:feat/mariadb-pair-scenario
Keel-Linux:feat/mariadb-pair-semisync
Keel-Linux:feat/etcd-root-issued-rbac
Keel-Linux:feat/vip-continuity-upgrades
Keel-Linux:fix/overlay-new-in-chain
Keel-Linux:feat/mesh-vip
Keel-Linux:ci/security-scan
Keel-Linux:fix/etcd-tests-pki-clock
Keel-Linux:feat/mesh-etcd
Keel-Linux:fix/mesh-full-mesh
Keel-Linux:feat/mesh-join
Keel-Linux:feat/mesh-token
Keel-Linux:fix/overlay-peer-not-this-node
Keel-Linux:feat/spec-cloud-section
Keel-Linux:fix/inspect-wireguard-window-keeps-spec
Keel-Linux:fix/inspect-wireguard-state
Keel-Linux:fix/inspect-on-a-keel-core
Keel-Linux:feat/overlay-state-hooks
Keel-Linux:feat/manifest-firewall
Keel-Linux:feat/manifest-apply
Keel-Linux:feat/manifest-reader
Keel-Linux:fix/database-waits-for-server
Keel-Linux:fix/replica-read-only
Keel-Linux:fix/seed-accounts-roles-server-id
Keel-Linux:feat/seed-replica
Keel-Linux:test/ssh-over-console
Keel-Linux:fix/lxc-console-confirm
Keel-Linux:fix/grant-compressed-ipv6
Keel-Linux:feat/wireguard-overlay
Keel-Linux:fix/hub-measured-honestly
Keel-Linux:feat/converge-tls-acme-apply
Keel-Linux:feat/converge-tls-acme
Keel-Linux:feat/converge-hostname
Keel-Linux:feat/converge-security-alerts
Keel-Linux:docs/manifest-unit-fields
Keel-Linux:pkg/keel-0.2.1
Keel-Linux:fix/hosts-read-as-the-resolver-reads
Keel-Linux:docs/diff-converged-field
Keel-Linux:fix/hosts-keeps-one-entry-for-the-host
Keel-Linux:feat/firstboot-system-hook
Keel-Linux:feat/apply-system-only
Keel-Linux:feat/apply-fqdn-hosts
Keel-Linux:fix/security-updates-name
Keel-Linux:fix/diff-disabled-feature
Keel-Linux:fix/inspect-ipv6-slaac
Keel-Linux:feat/apply-users-locale
Keel-Linux:fix/verify-cache-names
Keel-Linux:feat/render-ip6
Keel-Linux:fix/diff-secret-files
Keel-Linux:feat/diff
Keel-Linux:feat/inspect
Keel-Linux:docs/license
Keel-Linux:feat/pull-assemble
No reviewers
Labels
Clear labels
Barrier affecting people with disabilities
Something isn't working
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Good for newcomers
Extra attention is needed
This doesn't seem right
Further information is requested
This will not be worked on
accessibility
Barrier affecting people with disabilities
bug
Something isn't working
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
question
Further information is requested
wontfix
This will not be worked on
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference
Keel-Linux/keel!136
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/claim-txn-bounded-retry"
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 #135.
Problem
keel vip promotemade one claim transaction in etcd, with a 10.5 s timeout. On the lossy link it timed out ("etcd did not take the claim: etcdctl txn: no answer within 10.5 s"), and the promote failed, although a bounded retry would win.The second failure is a consequence
"keel-vip.service did not add the address to wg0 within 15 s" comes from the first failure. A transaction that times out may have committed. Then this node's claim was in etcd with a lease that no node renewed, because the promote recorded nothing. The next promote found that claim (
raced) and waited for an address that no controller would add.test_a_claim_of_its_own_found_in_etcd_is_held_with_its_leaseshows the same message on the old code.Change (safety first: a retry never makes a second holder)
keel/mesh/vipetcd.py(claim). After a transaction that etcd did not answer in time, the counter is read first:None), and the promote says another claim came first;The retries are bounded: at most 3 tries, and none starts 30 s after the first. A lease older than 10 s is replaced before a try, with the claim signed again. The leases of the tries that did not win are revoked, so a late transaction with one of them fails in etcd: at most one claim lands.
keel/mesh/vippromote.py(raced): this node's own claim found in etcd is verified and recorded with its lease, so the controller renews the lease and carries the address.Also:
docs/vip.md;debian/changelog0.23.14.Tests
tests/test_mesh_vipclaim.py, one test per branch:racedrecording its own claim, and refusing one that does not verify or is older than the file.New job
vip-claim / trixie(tests/test_vip_claim_netns.py), on the vip job's nodes at 250 ms ±25 ms and 2 % loss.tests/etcdctl_shim.py, first on the agents' PATH, loses the answer of one chosen transaction:Both promotes must take the VIP, and
tests/vip_overlap.pymust prove that no two nodes carry it at one instant.Test plan
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.