Skip to content

fix: retry recovery window status conflicts - #1110

Closed
andrewmaspero wants to merge 1 commit into
cloudnative-pg:mainfrom
andrewmaspero:codex/retry-recovery-window-conflicts
Closed

andrewmaspero wants to merge 1 commit into
cloudnative-pg:mainfrom
andrewmaspero:codex/retry-recovery-window-conflicts

Conversation

@andrewmaspero

Copy link
Copy Markdown

Problem

Retention and backup completion can update the same ObjectStore status concurrently. updateRecoveryWindow currently writes an object read before the status update, so an optimistic-lock conflict aborts retention even though retrying against the latest resource version is safe.

Change

Retry recovery-window status updates on conflict. Each attempt fetches the latest ObjectStore, changes only the selected server's recovery-window fields, and preserves status fields written concurrently.

The unit test injects one status conflict and a concurrent LastFailedBackupTime update, then verifies the retry succeeds without losing that field.

Validation

  • CGO_ENABLED=0 go test ./internal/cnpgi/instance
  • All non-e2e packages passed under CGO_ENABLED=0 go test ./...; the e2e suite could not start its deployment in the local environment and timed out before running any specs.

@andrewmaspero
andrewmaspero requested a review from a team as a code owner September 22, 2026 04:27
@andrewmaspero
andrewmaspero deleted the codex/retry-recovery-window-conflicts branch September 22, 2026 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant