Fix WAL data loss on instance hibernation/shutdown (#10341) by abhayclasher · Pull Request #10352 · cloudnative-pg/cloudnative-pg

@dosubot dosubot bot added the size:XS

This PR changes 0-9 lines, ignoring generated files.

label

Mar 22, 2026

@abhayclasher

When a CNPG instance is shut down (e.g. during hibernation), the last
WAL segments might remain on local storage and not be archived to
the object store. This is because ArchiveAllReadyWALs() was only
triggered during switchover/demotion.

This commit ensures that ArchiveAllReadyWALs() is also called after
a successful smart/fast shutdown in the lifecycle loop, preventing
data loss of the final WAL segments.

References: cloudnative-pg#10341
Signed-off-by: Abhay Kumar <abhaypro.cloud@gmail.com>