Skip to content

fix(operator): recover autosave after a preserve-power Backup disappears - #1161

Open
Baylem wants to merge 2 commits into
masterfrom
fix/965-orphan-backup-autosave
Open

Baylem wants to merge 2 commits into
masterfrom
fix/965-orphan-backup-autosave

Conversation

@Baylem

@Baylem Baylem commented Nov 29, 2026

Copy link
Copy Markdown
Member

If the agent stays offline through the Backup's ten-minute deletion retry, the finalizer can finish while the original game still has autosave disabled. On master at f7303559, the GameServer skips that owner because a preserve-power backup has no stopped-backup record. Recovery then requires another lifecycle operation to arrive.

This change wakes the GameServer on Backup deletion. It checks the missing Backup's UID, claims recovery against competing operations, revokes the original workers' authorization, and waits for them to drain. It retries save-on against the recorded game process or confirms that the process exited. While the result is uncertain, the GameServer keeps the workload fenced and reports RecoveryIntervention. The bounded Backup finalizer and the user's current power intent are preserved.

PR #1158 addresses verification of save-on while a Backup still exists. This PR handles recovery after that object disappears. It is based directly on master, and Git reports a clean merge with #1158 at 6849052b.

Regression coverage exercises a real sequence of controller reconciliations with a simulated agent outage and clock, including finalizer expiry, restored connectivity, controller restart, worker drain, same-name Backup replacement, ambiguous process identity, and a competing successor. The Linux operator and controller test sources compiled locally. Tests run in CI.

Fixes #965

@Baylem
Baylem requested a review from ValgulNecron as a code owner November 29, 2026 03:45
@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 51 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between f730355 and d8c508f.

Files selected for processing: 13

  • changelog/unreleased/1161-orphan-backup-autosave.md
  • docs/operator-operations.md
  • i18n/locales/en/app.json
  • operator/hack/condition-ids/main.go
  • operator/internal/controller/backup_guard_test.go
  • operator/internal/controller/backup_legacy_recovery_test.go
  • operator/internal/controller/backup_stop.go
  • operator/internal/controller/gameserver_backup_watch_test.go
  • operator/internal/controller/gameserver_controller.go
  • operator/internal/controller/gameserver_orphan_backup_test.go
  • operator/internal/controller/lifecycle_operation.go
  • operator/internal/controller/recovery_controller_test.go
  • operator/specs.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@Baylem Baylem added type: fix Bug fix area: operator controller-runtime operator and CRDs labels Nov 29, 2026 — with ChatGPT Codex Connector
@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

CI Report - d8c508f

run 46230631575 - attempt 1

0 failed - 25 passed - 8 skipped - 47m34s elapsed

Test selection: partial - per-suite table

Coverage

Module Measured Gate Margin
web L94.01 S92.1 B87.27 F89.85 L92 S92 B82 F76 +0.10

Changed

Area Files +/-
operator/ 10 +548/-45
docs/ 1 +15/-8
i18n/ 1 +4/-0
changelog/ 1 +3/-0

Slowest jobs

Job Duration
e2e telemetry / arm64 (kind) 24m16s
e2e telemetry / amd64 (kind) 23m56s
e2e postgres / amd64 (kind) 21m31s
e2e restricted-workloads / arm64 (kind) 15m59s
e2e restricted-workloads / amd64 (kind) 15m4s

e2e buckets run

api-agent, api-auth, api-mods, api-rbac, api-roles, backup-archives, backup-preparation, bot-fast, management-placement, monitoring, multicluster, network-isolation, operator, optional-components, postgres-availability, postgres-ha, postgres-pitr, ratelimit, recovery, restricted-workloads, sftp, standalone, telemetry, themes, upgrade, wake-hostport

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: operator controller-runtime operator and CRDs type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recover autosave after a preserve-power Backup disappears without a successor

1 participant