fix: a restart of the VIP's unit renews the lease once before it goes (keel#87) #145
Open
marcos-mendez wants to merge 1 commit from
fix/vip-restart-renewal into main
pull from: fix/vip-restart-renewal
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:feat/mesh-keepalive
Keel-Linux:fix/promote-announce-in-background
Keel-Linux:fix/overlay-mtu-live
Keel-Linux:fix/claim-txn-bounded-retry
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!145
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/vip-restart-renewal"
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?
keel#87 promised that the VIP survives an upgrade.
vip-upgrade / trixiefailed on #143 and on main: after a try-restart of keel-vip.service on the holder, a sample found no node carrying the VIP, 4.47 s after the restart (dropped_s: 4.47,holders_seen: [[], ['A']]).Cause
An address kept across a restart keeps the lifetime of the old controller's last confirmed renewal: RELEASE_AFTER (10 s), less the renewal's age, less 1 s of slack. The next controller extends it only after it has renewed the lease itself.
On the test's link (250 ms ±25 ms, 2% loss), each renewal is a keep-alive plus a linearizable read, each over a new TLS connection. So the last renewal is often seconds old when the restart comes. The stop (1.19 s in the failed run), the start, and the next controller's first renewal took longer than the time left, and the kernel removed the address until the new controller carried it again. This is a product gap, not a test artifact: the sampler already reads each false result a second time (keel#94).
Fix
keel vip tend --stopped(the unit's ExecStopPost,keel/mesh/vipetcd.py:stopped,handed_over) now renews the lease once while the unit restarts, as the controller does. It then gives the address the lifetime that this renewal leaves, so the next controller has the whole release time. The safety bound stays: the lifetime comes from a renewal that the majority confirmed. With no answer from etcd, the address stays as it was and the kernel ends it on time. A lease that is gone drops it. A plain stop renews nothing.docs/vip.mdsays so. Version 0.23.18 (#144 holds 0.23.17).Tests
tests/test_mesh_vipupgrade.py(TestHandOver). A restart with a renewal 5 s old renews once (keep-alive, then read) and gives the address the full lifetime. No answer leaves the lifetime as it is. A lease that is gone drops the address. A stop renews nothing. An address not carried again is said. The default client is this member's etcd. These tests failed before the fix (stopped()had no renewal).Proof on the platform:
vip-upgrade / trixiemust pass 5 times on this head. I record each run below.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.