Skip to content

[Feature]: continue wal archiving from new primary to s3 #8846

Closed as not planned

Description

@zjworacle

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?

No

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    triage
    on Oct 14, 2025
  2. 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
  3. gbartolini commented on Oct 14, 2025

    @gbartolini
    Contributor

    Hi @zjworacle, can you please describe the issue better here and help me understand what you are trying to achieve? Thanks.

  4. zjworacle commented on Oct 14, 2025

    @zjworacle
    Author

    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.

  5. zjworacle commented on Oct 14, 2025

    @zjworacle
    Author

    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.

  6. gbartolini commented on Oct 15, 2025

    @gbartolini
    Contributor

    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.

    This is actually a great idea!

  7. github-actions commented on Dec 15, 2025

    @github-actions
    Contributor

    This issue is stale because it has been open for 60 days with no activity.

  8. github-actions commented on Dec 29, 2025

    @github-actions
    Contributor

    This issue was closed because it has been inactive for 14 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Staletriage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions