Repository navigation
fix(instance-manager): stop a superseded primary when the isolation check is disabled - #11795
Conversation
|
❗ By default, the pull request is configured to backport to all release branches.
|
|
/test |
|
@mnencia, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/40897533264 |
47bfc92 to
5700189
Compare
|
/test |
|
@mnencia, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/41029103260 |
|
/test |
|
@mnencia, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/41038742374 |
…heck is disabled With the isolation check disabled, a primary never looked at its peers, so one that could not reach the API server kept running even after a peer reported that another instance had been named the target primary. That answer is proof that the primary was replaced, not a sign of isolation. The peers are now probed whatever the setting says. Disabled, only a peer that names another target primary stops the primary. Unreachable peers do not, so an isolated primary keeps running, as it did before. Closes #11777 Assisted-by: Claude Signed-off-by: Marco Nenciarini <[email protected]>
…the isolation check is disabled The pinger already carries the isolation check configuration, so it can leave an unreachable peer out of the failures itself when the check is disabled. shouldStepDown then needs no special case: whatever ensureInstancesAreReachable reports is a reason to step down. This removes the reordering of the probe results and the package-level checker constructor that the tests had to swap. The verdict is the same for every combination of peer answers; with the check enabled the logged reason is again the first failure found, as on main. Signed-off-by: Armando Ruocco <[email protected]>
252f209 to
38caa22
Compare
Signed-off-by: Leonardo Cecchi <[email protected]>
|
/test |
|
@leonardoce, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/41617178774 |
…heck is disabled (cloudnative-pg/cloudnative-pg#11795) With the isolation check disabled, a primary never looked at its peers, so one that could not reach the API server kept running even after a peer reported that another instance had been named the target primary. That answer is proof that the primary was replaced, not a sign of isolation. The peers are now probed whatever the setting says. Disabled, only a peer that names another target primary stops the primary. Unreachable peers do not, so an isolated primary keeps running, as it did before. Closes cloudnative-pg/cloudnative-pg#11777 Signed-off-by: Marco Nenciarini <[email protected]> Signed-off-by: Armando Ruocco <[email protected]> Signed-off-by: Leonardo Cecchi <[email protected]> Co-authored-by: Armando Ruocco <[email protected]> Co-authored-by: Leonardo Cecchi <[email protected]> (cherry picked from commit cloudnative-pg/cloudnative-pg@3207622)
With the isolation check disabled, a primary never looked at its peers, so one that could not reach the API server kept running even after a peer reported that another instance had been named the target primary. That answer is proof that the primary was replaced, not a sign of isolation.
The peers are now probed whatever the setting says. Disabled, only a peer that names another target primary stops the primary. Unreachable peers do not, so an isolated primary keeps running, as it did before.
Closes #11777
Reviewer notes
An enabled check behaves as before. When an unreachable peer and a peer naming another target show up in the same round, the logged reason is now the superseded one instead of whichever came first.
The comparison is by target name only, so a peer with a stale cache that still names an older target would now also stop a disabled primary, as it already stops an enabled one. A cluster with no
isolationCheckstanza at all still skips the check, as before.Unit tests cover the disabled and enabled cases and the single-instance skip; e2e not run. Checked by hand on kind: with the check disabled, the primary's route to the API server dropped and
status.targetPrimarypatched to a replica, the primary now stops (container exit code 5, two seconds after the patch). Without the change it kept running and accepting writes for 110 seconds. With the whole node cut off from every peer, a disabled check still does not stop the primary, as before.tests/e2e/primary_self_isolation_test.gokeeps its disabled fixture unchanged, for the same reason.