Skip to content

[Backport release-1.6] fix(postgres): read the live Cluster when deciding the WAL-archive prefix - #4592

Merged
myasnikovdaniil merged 1 commit into
release-1.6from
backport-4299-to-release-1.6
Oct 14, 2026
Merged

myasnikovdaniil merged 1 commit into
release-1.6from
backport-4299-to-release-1.6

Conversation

@github-actions

Copy link
Copy Markdown

Description

Backport of #4299 to release-1.6.

@github-actions

Copy link
Copy Markdown
Author

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-4299-to-release-1.6
git worktree add --checkout .worktree/backport-4299-to-release-1.6 backport-4299-to-release-1.6
cd .worktree/backport-4299-to-release-1.6
git reset --hard HEAD^
git cherry-pick -x 67bf9ca317879299241bea62b0a172dfc01ea5a0
git push --force-with-lease

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: cozystack/cozystack/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e82a617e-a6bd-4301-a4f3-a86c5b91aa6f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • 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

Comment @coderabbitai help to get the list of available commands.

…efix

applyClusterPluginBackup preserves the serverName already on the Cluster, so
that a backup does not flip the archive prefix mid-stream. It read that value
through the manager's cached client, and this controller registers
For(&BackupJob{}) and nothing else, so a Cluster only reaches the cache
through a lazily started informer with no resync tied to its own changes.

An in-place RestoreJob deletes the Cluster and the chart re-renders it with
bootstrap.newServerName seconds later. A read served during that window
describes the object that was purged, so the source's serverName is written
back over the freshly rendered one and the restored cluster archives onto the
source's WAL prefix. barman-cloud-check-wal-archive then refuses to start with
"Expected empty archive" and the RestoreJob ends on its deadline -- the
failure newServerName was added to prevent.

The stale read carries a stale UID too, and that UID owns the ObjectStore this
function applies, so the store is garbage-collected as soon as it is written.

Reading through the dynamic client keeps the preservation rule and makes the
value it rests on truthful.

Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <[email protected]>
(cherry picked from commit 67bf9ca)
Signed-off-by: Myasnikov Daniil <[email protected]>
@myasnikovdaniil
myasnikovdaniil force-pushed the backport-4299-to-release-1.6 branch from c9ea998 to 70424ee Compare October 14, 2026 09:24
@github-actions github-actions Bot added area/database Issues or PRs related to managed databases (postgres, mariadb, redis, etcd, kafka, clickhouse) area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) kind/bug Categorizes issue or PR as related to a bug size/M This PR changes 30-99 lines, ignoring generated files labels Oct 14, 2026
@myasnikovdaniil
myasnikovdaniil marked this pull request as ready for review October 14, 2026 09:51
@myasnikovdaniil
myasnikovdaniil merged commit 7e8399c into release-1.6 Oct 14, 2026
43 checks passed
@myasnikovdaniil
myasnikovdaniil deleted the backport-4299-to-release-1.6 branch October 14, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/database Issues or PRs related to managed databases (postgres, mariadb, redis, etcd, kafka, clickhouse) area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) kind/bug Categorizes issue or PR as related to a bug size/M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants