feat: "unrecoverable" annotation#8178
Conversation
|
❗ By default, the pull request is configured to backport to all release branches.
|
d77b05b to
a344a30
Compare
a344a30 to
664fc84
Compare
|
This patch is marked as a draft because we miss E2e tests and we should improve the documentation. |
583f6cf to
4cda8d4
Compare
|
I added a basic E2e test. |
|
/test limit=local |
|
@leonardoce, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/16617908831 |
4cda8d4 to
bc49794
Compare
8aa893e to
9673609
Compare
|
I find it a bit counterintuitive to put the annotation on the Pod to trigger deletion of the Pod and all its PVCs. The intent here is clearly storage/instance-scoped, while a Pod is ephemeral. If PVC deletion fails and the Pod disappears for any reason, the request is gone. I’d really prefer to see the trigger live on something more persistent (like the PVC or the Cluster spec/status) so the action is durable and auditable. |
|
Should the relevant issue which this PR was intended for be linked to this PR? |
b5b8bf8 to
d50c6a6
Compare
52096ab to
8b8f7f2
Compare
|
/test |
|
@mnencia, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/17951525849 |
|
I spoke with @leonardoce, and we agreed that the patch is safe, provided we change the order of the delete operations. Specifically, I changed the patch to issue the Pod delete after the PVCs one. I will merge once the end-to-end (E2E) tests have passed. |
8b8f7f2 to
4c0c9de
Compare
|
@mnencia @leonardoce We've successfully tested an alternative approach that fixes, within CNPG, the CNPG crash loop observed, |
35b3c8a to
0b14441
Compare
|
/test |
|
@mnencia, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/18319013805 |
This patch make the operator look for the "alpha.cnpg.io/unrecoverable=true" annotation in the PG instance Pods. If such an annotation is detected, the operator will destroy the PVCs and the Pod itself and recreate it from the other instances. This annotation is available only for replica instances. Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
This patch introduces the annotation `alpha.cnpg.io/unrecoverable=true`, which can be added to any replica instance Pod. When this annotation is present, the operator will permanently delete the associated instance by removing both the PVCs and the Pod itself. Following this, the operator will recreate the missing instance from the primary instance. Please note that this annotation is available only for replica instances. Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com> Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com> Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Co-authored-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com> Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
This patch introduces the annotation `alpha.cnpg.io/unrecoverable=true`, which can be added to any replica instance Pod. When this annotation is present, the operator will permanently delete the associated instance by removing both the PVCs and the Pod itself. Following this, the operator will recreate the missing instance from the primary instance. Please note that this annotation is available only for replica instances. Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com> Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com> Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Co-authored-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com> Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Signed-off-by: theBrahma <office.utpal.brahma@gmail.com>
|
What's the difference between |
This patch introduces the annotation
alpha.cnpg.io/unrecoverable=true, which can be added to any replica instance Pod.When this annotation is present, the operator will permanently delete the associated instance by removing both the PVCs and the Pod itself. Following this, the operator will recreate the missing instance from the primary instance.
Please note that this annotation is available only for replica instances.