Skip to content

Commit c8846cf

Browse files
committed
fix: disable end-of-wal flag management during backup restoration
Port of upstream PR cloudnative-pg#604. When CurrentPrimary is empty (first instance), streaming is not available — prevents incorrect WAL predictions with custom segment sizes during restore.
1 parent 63d19e1 commit c8846cf

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

internal/cnpgi/common/wal.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,11 @@ func isStreamingAvailable(cluster *cnpgv1.Cluster, podName string) bool {
431431
return false
432432
}
433433

434+
// First instance of a new cluster: streaming is not available yet
435+
if cluster.Status.CurrentPrimary == "" {
436+
return false
437+
}
438+
434439
// Easy case: If this pod is a replica, the streaming is always available
435440
if cluster.Status.CurrentPrimary != podName {
436441
return true

0 commit comments

Comments
 (0)