Re: Questions about the continuity of WAL archiving - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Questions about the continuity of WAL archiving
Date
Msg-id ce2b8db9-1d9f-4294-90d5-beef3f8a9e87@aklaver.com
Whole thread Raw
In response to Re: Questions about the continuity of WAL archiving  (px shi <spxlyy123@gmail.com>)
List pgsql-general
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.graf@gmail.com <mailto:zzzzz.graf@gmail.com>> 于2025年8月 
> 13日周三 10:51写道:
> 
-- 
Adrian Klaver
adrian.klaver@aklaver.com



pgsql-general by date:

Previous
From: Justin
Date:
Subject: Re: Questions about the continuity of WAL archiving
Next
From: Achilleas Mantzios
Date:
Subject: Strange deadlock with object/target of lock : transaction