Re: Questions about the continuity of WAL archiving

From: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
To: px shi <spxlyy123(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Questions about the continuity of WAL archiving
Date: 2025-08-08 18:25:13
Message-ID: CAKAnmmJPGgEp2kKPomhq7P=GUA5HD1eOaP5X+7c68gm5f4YVqQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> There is a scenario: the current timeline of the PostgreSQL primary node
> is 1, and the latest WAL file is 100. The standby node has also received up
> to WAL file 100. However, the latest WAL file archived is only file 80. If
> the primary node crashes at this point and the standby is promoted to the
> new primary, archiving will resume from file 100 on timeline 2. As a
> result, WAL files from 81 to 100 on timeline 1 will be missing from the
> archive.
> Is there a good solution to prevent this situation?
>

I'm still not clear on what the problem here is, other than your archiving
not keeping up. The best solution to that is:

https://pgbackrest.org/1/configuration.html#section-archive/option-archive-async

Yes, you would lost some ability for easy PITR for 80-100, but could still
be done by resurrecting your crashed primary, or carefully grabbing from
the replica before they get recycled. You can set archive_mode=always on
the replicas to help with this.

Cheers,
Greg

--
Crunchy Data - https://www.crunchydata.com
Enterprise Postgres Software Products & Tech Support

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2025-08-08 18:45:02 Re: Questions about the continuity of WAL archiving
Previous Message Adrian Klaver 2025-08-08 15:23:50 Re: Questions about the continuity of WAL archiving