Skip to content

fix: restore WAL from replica source during designated primary promotion#966

Open
leonardoce wants to merge 1 commit into
cloudnative-pg:mainfrom
leonardoce:restore-wal-replica-promotion
Open

fix: restore WAL from replica source during designated primary promotion#966
leonardoce wants to merge 1 commit into
cloudnative-pg:mainfrom
leonardoce:restore-wal-replica-promotion

Conversation

@leonardoce

Copy link
Copy Markdown
Contributor

During a replica cluster failover, the designated primary could incorrectly attempt to restore WALs from its own object store instead of the replica source, causing recovery to fail. This happened because the previous logic relied on IsReplica() returning true, but that flag can already be false while PostgreSQL is still in recovery and needs WALs from the source cluster.

During a replica cluster failover, the designated primary could incorrectly
attempt to restore WALs from its own object store instead of the replica
source, causing recovery to fail. This happened because the previous logic
relied on IsReplica() returning true, but that flag can already be false
while PostgreSQL is still in recovery and needs WALs from the source cluster.

Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
@leonardoce leonardoce requested a review from a team as a code owner June 16, 2026 15:35
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working go Pull requests that update go code labels Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working go Pull requests that update go code size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant