public inbox for [email protected]help / color / mirror / Atom feed
Questions about the continuity of WAL archiving 4+ messages / 2 participants [nested] [flat]
* Questions about the continuity of WAL archiving @ 2025-08-08 03:20 px shi <[email protected]> 0 siblings, 1 reply; 4+ messages in thread From: px shi @ 2025-08-08 03:20 UTC (permalink / raw) To: [email protected] Hi, 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? Regards, Pixian Shi ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Questions about the continuity of WAL archiving @ 2025-08-08 04:25 Adrian Klaver <[email protected]> parent: px shi <[email protected]> 0 siblings, 1 reply; 4+ messages in thread From: Adrian Klaver @ 2025-08-08 04:25 UTC (permalink / raw) To: px shi <[email protected]>; [email protected] On 8/7/25 20:20, px shi wrote: > Hi, > 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. What are you planning to do with the archived files? Also is not the case that once the primary crashes you are in a split brain case and can't really trust it's timeline anymore? > Is there a good solution to prevent this situation? > > Regards, > Pixian Shi -- Adrian Klaver [email protected] ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Questions about the continuity of WAL archiving @ 2025-08-08 05:50 px shi <[email protected]> parent: Adrian Klaver <[email protected]> 0 siblings, 1 reply; 4+ messages in thread From: px shi @ 2025-08-08 05:50 UTC (permalink / raw) To: Adrian Klaver <[email protected]>; +Cc: [email protected] Thank you for your reply. The archived files can be used for PITR (Point-In-Time Recovery), allowing recovery to any point between WAL 80 and 100 on timeline 1. Additionally, if there's a backup taken during timeline 1 and a switchover to a new primary has occurred without taking a new full backup yet, these WAL logs can still be used to recover to any point on timeline 2. Regards, Pixian Shi Adrian Klaver <[email protected]> 于2025年8月8日周五 12:25写道: > On 8/7/25 20:20, px shi wrote: > > Hi, > > 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. > > What are you planning to do with the archived files? > > Also is not the case that once the primary crashes you are in a split > brain case and can't really trust it's timeline anymore? > > > > Is there a good solution to prevent this situation? > > > > Regards, > > Pixian Shi > > > -- > Adrian Klaver > [email protected] > ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Questions about the continuity of WAL archiving @ 2025-08-08 15:23 Adrian Klaver <[email protected]> parent: px shi <[email protected]> 0 siblings, 0 replies; 4+ messages in thread From: Adrian Klaver @ 2025-08-08 15:23 UTC (permalink / raw) To: px shi <[email protected]>; +Cc: [email protected] On 8/7/25 22:50, px shi wrote: > Thank you for your reply. > The archived files can be used for PITR (Point-In-Time Recovery), > allowing recovery to any point between WAL 80 and 100 on timeline 1. > Additionally, if there's a backup taken during timeline 1 and a > switchover to a new primary has occurred without taking a new full > backup yet, these WAL logs can still be used to recover to any point on > timeline 2. Alright I see. Two things: 1) What is the current archiving setup on the primary and why is lagging? 2) Have you looked at archiving off the standby node while it is in standby per: https://www.postgresql.org/docs/current/warm-standby.html#CONTINUOUS-ARCHIVING-IN-STANDBY > > Regards, > Pixian Shi > > Adrian Klaver <[email protected] > <mailto:[email protected]>> 于2025年8月8日周五 12:25写道: > > On 8/7/25 20:20, px shi wrote: > > Hi, > > 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. > > What are you planning to do with the archived files? > > Also is not the case that once the primary crashes you are in a split > brain case and can't really trust it's timeline anymore? > > > > Is there a good solution to prevent this situation? > > > > Regards, > > Pixian Shi > > > -- > Adrian Klaver > [email protected] <mailto:[email protected]> > -- Adrian Klaver [email protected] ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2025-08-08 15:23 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2025-08-08 03:20 Questions about the continuity of WAL archiving px shi <[email protected]> 2025-08-08 04:25 ` Adrian Klaver <[email protected]> 2025-08-08 05:50 ` px shi <[email protected]> 2025-08-08 15:23 ` Adrian Klaver <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox