Commit 72df4c1
fix(switchover): recreate primary when WAL-archiver sidecar is missing (cloudnative-pg/cloudnative-pg#11032)
Enabling a WAL-archiver plugin on an existing cluster leaves the primary
Pod without the injected sidecar, so it cannot archive WAL. When
`primaryUpdateMethod` is set to `switchover`, the operator rolls the
primary out by demoting it, but a clean demotion archives all pending
WAL before pg_rewind, and that archiving needs the very sidecar that is
still missing. The switchover never completes, the primary is marked
unhealthy and dropped from the -rw service, and the cluster dead-locks.
Detect this case in `updatePrimaryPod` and recreate the primary Pod in
place instead of switching over. It comes back as primary with the
sidecar, archiving resumes, and no demotion or rewind is involved.
Detecting the missing sidecar from instance status during reconciliation
replaces the previous mechanism, where the instance manager exited with
a dedicated code and the controller deleted the Pod, so that code is
removed.
Closes cloudnative-pg/cloudnative-pg#10981
Closes cloudnative-pg/plugin-barman-cloud#901
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
(cherry picked from commit cloudnative-pg/cloudnative-pg@6b275c3)1 parent ff2f432 commit 72df4c1
1 file changed
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | 122 | | |
128 | 123 | | |
129 | 124 | | |
| |||
0 commit comments