Repository navigation
fix(instance): skip startup probe during active WAL replay - #11138
ardentperf wants to merge 3 commits into
Conversation
Detect replicas stuck in repeated unrecoverable WAL replay errors and marks the instance unhealthy using existing CNPG health paths. Adds an instance `statusError` field and adds a log monitor path for CSV log records that detects unrecoverable WAL replay loops. Signed-off-by: Jeremy Schneider <[email protected]>
to support multiple detectors, base this on a multirecordwriter now. this is a better direction than chaining writers. Signed-off-by: Jeremy Schneider <[email protected]>
The startup probe currently depends on PostgreSQL accepting connections. That can make a replica look failed while PostgreSQL is still making forward progress through crash recovery or WAL replay, causing Kubernetes to restart the pod and repeat the same work. This builds on the logpipe infrastructure from cloudnative-pg#11135 and records the timestamp of PostgreSQL `redo in progress` log messages that include the current LSN. While one of those messages was seen in the last five minutes, `/startupz` reports `Skipped` instead of failing the startup probe. If the signal is stale or absent, the code stops replay-progress detection for this process and falls back to the existing startup checker. The detector also stops as soon as PostgreSQL logs that the database system is ready to accept connections. At that point replay-progress detection is no longer useful, and stopping it avoids running the regex against later log messages. Prerequisite: cloudnative-pg#11135 Fixed: cloudnative-pg#11024 Signed-off-by: Jeremy Schneider <[email protected]>
|
❗ By default, the pull request is configured to backport to all release branches.
|
|
Thanks for this work, and especially for the diagnosis in #11024 — the While reviewing I ran into a few things that, as far as I can tell, 1. I couldn't find the 2. On primaries, the first probe may disable detection before the 3. I'm not sure the staleness fallback can ever run. Once the probe To be clear on severity: even if I'm right about 1 and 2, the effect is Since I believe the probe-side idea itself is the right one, I also |
|
thanks for taking a look. sampling the startup process title actually seems like a better approach to me than looking for the |
|
i'm going to close this in favor of #11141 |
|
❗ By default, the pull request is configured to backport to all release branches.
|
The startup probe currently depends on PostgreSQL accepting connections. That can make a replica look failed while PostgreSQL is still making forward progress through crash recovery or WAL replay, causing Kubernetes to restart the pod and repeat the same work. This builds on the logpipe infrastructure from #11135 and records the timestamp of PostgreSQL
redo in progresslog messages that include the current LSN. While one of those messages was seen in the last five minutes,/startupzreportsSkippedinstead of failing the startup probe. If the signal is stale or absent, the code stops replay-progress detection for this process and falls back to the existing startup checker. The detector also stops as soon as PostgreSQL logs that the database system is ready to accept connections. At that point replay-progress detection is no longer useful, and stopping it avoids running the regex against later log messages.Prerequisite: #11135
Fixes: #11024