On 8/12/25 22:48, px shi wrote:
Here’s a scenario: The latest WAL file on the primary node is 0000000100000000000000AF, and the standby node has also received up to 0000000100000000000000AF. However, the latest WAL file that has been successfully archived from the primary is only 0000000100000000000000A1 (WAL files from A2 to AE have not yet been archived). If the primary crashes at this point, triggering a failover, the new primary will start generating and archiving WAL on a new timeline (2), beginning with 0000000200000000000000AF. It will not backfill the missing WAL files from timeline 1 (0000000100000000000000A2 to 0000000100000000000000AE). As a result, while the new primary does not have any local WAL gaps, the archive directory will contain a gap in that WAL range.
I’m not sure if I explained it clearly.

Why does it matter?

1) Your standby is starting off up to date.

2) You can do a pg_basebackup from the new primary as a base for the restart of the old primary. Assuming you have archiving set up on the new primary then the restarted primary can catch up.

3) If you don't want to do 2) then you need an archive location that can deal with the velocity of the WAL archiving.



Justin <zzzzz.g...@gmail.com <mailto:zzzzz.g...@gmail.com>> 于2025年8月 13日周三 10:51写道:

--
Adrian Klaver
adrian.kla...@aklaver.com


Reply via email to