Repository navigation
Conversation
|
/test |
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/24897811115 |
|
❗ By default, the pull request is configured to backport to all release branches.
|
359f3df to
1e97eb7
Compare
4510248 to
a4a7600
Compare
|
/test |
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/24992794954 |
a4a7600 to
70c5353
Compare
38d415b to
8499979
Compare
|
/test |
b9a501b to
653d38a
Compare
e6a0486 to
11f2b32
Compare
11f2b32 to
7383275
Compare
7edc6a5 to
3b653bb
Compare
|
Is this related to EnterpriseDB/barman@4f43dc5? |
2c92ab4 to
5337349
Compare
5337349 to
c30c179
Compare
|
/test |
|
@mnencia, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/41511632041 |
c30c179 to
f86ab03
Compare
Add spec.walRestoreRetryTimeout and a retry loop inside
`manager wal-restore` so that transient failures during WAL replay —
network blips, flaky object stores, plugin glitches — do not cause a
replica to promote on an incomplete archive and lose already-archived
transactions.
The command now classifies each attempt's outcome:
* barman-cloud exit 0 or gRPC Ok -> success (exit 0)
* barman-cloud exit 1 or gRPC NotFound -> WAL not found (exit 1,
unchanged; PostgreSQL can transition to streaming as before)
* anything else -> transient, retry with exponential backoff up to
retryBackoffCap (30s), within the user-configurable budget
If the budget is exhausted the command exits with code 255, which tells
PostgreSQL to stop log-shipping replication rather than promote on a
partial archive. The budget defaults to 5 minutes; the new
spec.walRestoreRetryTimeout field (*metav1.Duration) lets operators
tune it, and the admission webhook rejects zero or negative values so
there is no silent opt-out of the protection.
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
The wal-restore retry loop exits with code 143 so PostgreSQL detects a SIGTERM and shuts down cleanly instead of promoting on a partial archive. The failover and replication pages still documented the earlier 255; align them with the implementation. Signed-off-by: Armando Ruocco <[email protected]>
The decision of whether to retry transient WAL-restore failures (bootstrap or target-primary of a standard cluster, and never a replica cluster) lived inline in runWalRestore with no direct test. Move it into a pure shouldRetryRestore function and add a table test covering the matrix, including the replica-cluster cases that must not retry because the first pod bootstraps in standby mode. Also correct the resolveMaxRetryTimeout comment: non-positive values are rejected by the field's CRD validation rule (a CEL XValidation), not by the admission webhook. Signed-off-by: Armando Ruocco <[email protected]>
A standby being promoted cannot know which WAL it still has to reach, so the retry budget was a guess that could delay a failover by minutes without a guarantee of any gain. Limit the retry to the bootstrap of a standard cluster, where recovery from a backup needs the whole WAL chain. Move the documentation to the recovery page and drop the promotion wording from the API field and the failover and replication pages. Signed-off-by: Marco Nenciarini <[email protected]>
fe6a141 to
b3cfa51
Compare
|
Closing this one. After discussing it with Leonardo, we think the retry covers a problem that needs to be solved at a different level. The instance manager can't tell a missing WAL from a failed restore by looking at barman exit codes or gRPC status codes, and plugins don't agree on what they return for a missing WAL. A retry budget on top of that is a guess. During a promotion it also delays the failover without knowing which WAL the instance still has to reach. The better fix is to define the CNPG-I WAL interface more precisely, so a plugin can say whether the WAL is missing, the failure is retryable, or the restore failed, and drive the return code itself. That work starts in CNPG-I. Thanks Armando and Leonardo for the work and the reviews. |
Add spec.walRestoreRetryTimeout and a retry loop inside
manager wal-restoreso that transient failures during WAL replay — network blips, flaky object stores, plugin glitches — do not cause a replica to promote on an incomplete archive and lose already-archived transactions.The command now classifies each attempt's outcome:
unchanged; PostgreSQL can transition to streaming as before)
retryBackoffCap (30s), within the user-configurable budget
If the budget is exhausted the command exits with code 255, which tells PostgreSQL to stop log-shipping replication rather than promote on a partial archive. The budget defaults to 5 minutes; the new spec.walRestoreRetryTimeout field (*metav1.Duration) lets operators tune it, and the admission webhook rejects zero or negative values so there is no silent opt-out of the protection.