You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: continue wal archiving from new primary to s3 #8846
Is there an existing issue already for this feature request/idea?
I have searched for an existing issue, and could not find anything. I believe this is a new feature request to be evaluated.
What problem is this feature going to solve? Why should it be added?
In cnpg 1.26.1, when replica has caught up, the wal archival to s3 hasn't, the cnpg will take very long time to switchover because cnpg tried to wait wal archival caught up till swithover-timeout, this put the cnpg cluster in switchover statue very long.
Describe the solution you'd like
An workaround would be switchover fast (as long as replica caught up)and use replica's wals to finish the archival.
Describe alternatives you've considered
Current cnpg's implementation is wait till s3 catchup.
Additional context
the database backup to s3 from standby.
Backport?
No
Are you willing to actively contribute to this feature?
changed the title [-][Feature]: continue wal archiving from new replica to s3[/-][+][Feature]: continue wal archiving from new primary to s3[/+]on Oct 14, 2025
Hi @gbartolini ,
The situation is s3 is slower than primary WAL generation speed and is slower than replica. The replica is enable to catch up primary near real-time (the replica's replication delay to primary is less than 1 second), WAL backup to s3 object store is slower, the cnpg status output shows that # of WALS to archive to s3 keep increasing.
In this situation, I observed the switchover will keep waiting for the primary to finish up the WAL archival, but that can't be met, since WAL archival speed in s3 side is slower than WAL generation speed in the primary.
To speed up the switchover, my suggested workaround is switchover to the caught-up replica making it as new primary (as long as it has caught up, and it did) and continue the WAL archival to s3 from the new primary (the old replica). Because the old replica has caught-up, it has all the WALs from old primary, no need to worry about the WAL loss. This can free up CNPG to take care of other reconciliations.
The other suggestion to speed up the switchover process is cnpg can issue checkpoint command before fast shutdown. Our database has massive writes in peak hours, so the checkpoint-timeout was to 1 hour, this made the fast shutdown is also slow.
The other suggestion to speed up the switchover process is cnpg can issue checkpoint command before fast shutdown. Our database has massive writes in peak hours, so the checkpoint-timeout was to 1 hour, this made the fast shutdown is also slow.
Activity
[-][Feature]: continue wal archiving from new replica to s3[/-][+][Feature]: continue wal archiving from new primary to s3[/+]gbartolini commentedon Oct 14, 2025
Hi @zjworacle, can you please describe the issue better here and help me understand what you are trying to achieve? Thanks.
zjworacle commentedon Oct 14, 2025
Hi @gbartolini ,
The situation is s3 is slower than primary WAL generation speed and is slower than replica. The replica is enable to catch up primary near real-time (the replica's replication delay to primary is less than 1 second), WAL backup to s3 object store is slower, the cnpg status output shows that # of WALS to archive to s3 keep increasing.
In this situation, I observed the switchover will keep waiting for the primary to finish up the WAL archival, but that can't be met, since WAL archival speed in s3 side is slower than WAL generation speed in the primary.
To speed up the switchover, my suggested workaround is switchover to the caught-up replica making it as new primary (as long as it has caught up, and it did) and continue the WAL archival to s3 from the new primary (the old replica). Because the old replica has caught-up, it has all the WALs from old primary, no need to worry about the WAL loss. This can free up CNPG to take care of other reconciliations.
zjworacle commentedon Oct 14, 2025
The other suggestion to speed up the switchover process is cnpg can issue checkpoint command before fast shutdown. Our database has massive writes in peak hours, so the checkpoint-timeout was to 1 hour, this made the fast shutdown is also slow.
gbartolini commentedon Oct 15, 2025
This is actually a great idea!
github-actions commentedon Dec 15, 2025
This issue is stale because it has been open for 60 days with no activity.
github-actions commentedon Dec 29, 2025
This issue was closed because it has been inactive for 14 days since being marked as stale.