Repository navigation
fix(failover): lower primary lease retry period default to 2s - #10950
Conversation
|
❗ By default, the pull request is configured to backport to all release branches.
|
0729313 to
4986ce3
Compare
|
/test ft=performance tl=4 d=main |
|
@mnencia, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/27819141568 |
4986ce3 to
90ae180
Compare
2d0dfd7 to
62c8e3b
Compare
|
/test ft=performance tl=4 d=main |
|
@NiccoloFei, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/27823874195 |
62c8e3b to
8d3d8d4
Compare
|
/test ft=performance tl=4 d=main |
|
@mnencia, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/27824242149 |
The primary lease retry period sets how often a promoting replica polls for a cleanly released lease, so at the previous 5s default a switchover hand-over waited up to a full poll cycle and inflated switchover time in 5s steps. Adopt the conventional Kubernetes leader-election value of 2s, shortening the clean hand-over without shortening the lease-duration take-over wait that holds back a premature promotion. Signed-off-by: Marco Nenciarini <[email protected]>
The sync fast-failover test deletes the primary abruptly, so it never releases the lease and the promoting replica must wait out the full lease duration before taking over. Widen that case's budget by the default lease duration; the async cases release within the grace period and keep the tighter budget. Signed-off-by: Marco Nenciarini <[email protected]>
The fast-failover tests delete the primary abruptly (quickDeletionPeriod). It usually still releases the primary lease inside the grace period and a replica promotes within a couple of seconds, but if the SIGKILL wins the race the lease is left held and the promoting replica must observe it unchanged for a full lease duration, then claim it on its next poll, before it can promote. That take-over window is engine-independent and dominates the failover when it happens, so bound the per-case budget by it (lease duration plus one retry period, with a small promotion margin) rather than adding it to the per-engine base. Apply it to every fast-failover case, not the sync one alone. Signed-off-by: Marco Nenciarini <[email protected]>
8d3d8d4 to
49a715e
Compare
The primary lease retry period sets how often a promoting replica polls for a cleanly released lease, so at the previous 5s default a switchover hand-over waited up to a full poll cycle and inflated switchover time in 5s steps. Adopt the conventional Kubernetes leader-election value of 2s, shortening the clean hand-over without shortening the lease-duration take-over wait that holds back a premature promotion.
The fast-failover e2e tests delete the primary abruptly, which SIGKILLs it before it can release the lease cleanly, so the promoting replica must wait out the full lease duration before taking over. That take-over window is part of the measured write outage and applies to every case, so the tests now budget it across all fast-failover scenarios rather than the sync case alone.