Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ukG00-0008Hx-K7 for pgsql-general@arkaria.postgresql.org; Fri, 08 Aug 2025 05:50:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1ukFzz-007Ew6-7R for pgsql-general@arkaria.postgresql.org; Fri, 08 Aug 2025 05:50:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ukFzy-007Evn-SQ for pgsql-general@lists.postgresql.org; Fri, 08 Aug 2025 05:50:38 +0000 Received: from mail-vs1-xe34.google.com ([2607:f8b0:4864:20::e34]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ukFzw-001O7R-1t for pgsql-general@lists.postgresql.org; Fri, 08 Aug 2025 05:50:38 +0000 Received: by mail-vs1-xe34.google.com with SMTP id ada2fe7eead31-4fc83dda10bso617869137.0 for ; Thu, 07 Aug 2025 22:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754632235; x=1755237035; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=0CCML4D7NRIktyHAkFjpdtC+2/7iD0tIfm3zWV3DndI=; b=QHhGKEQsxwu8fZdBMHhyYJhvI96lLc6q4KSAl6qftQ7d9RQ645fGGUJCasGvBa7PO2 cBTQgpgytuQmk/PAFRrcRJ0YZwbt1ygyltA2WHWAomwERsU540c1pw+ZhTNWJXhTvZyr wEwQyiRzdGpDT2YCEHKfBPeRQtO8nS1UpM9tYLlfqzJt7k6dZ4f1+7Fo6Wl9yjbHcLe+ bKCsCOTRWjIHuocUdS1l1SOrZy2g1gS+GRs1zw9akc/O1KF+rNaHYkiiWwKMgHWMy/j8 C5EvkrEGXADWb7v9MTrrr2uaW7l18vDvfKWceMl1br4b40Ra3gHyi1nbNJFhJN/JucPf +ryw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754632235; x=1755237035; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0CCML4D7NRIktyHAkFjpdtC+2/7iD0tIfm3zWV3DndI=; b=OEbtrlEsOKyaRQMUH7zXUXe5UrlV9sdbrYsy2Gsw4aOFMa+MB9YKZ4jO6HEOwYw712 dbCEIKLoPhRdgm/BY3P+PUYTSxghQJIDEEAxfvdbSkywKo8vuQkjHQfvNnYhckAHnBQ1 xvh/Ti1ko3wkumpxc83y2qNpaj0Z5J/FMl0HgOxO+LGSPaoCmlqz3Bs1s1eZES+r+wLY WWoRGR8h2ozl4M+CiWDgzxCqzJD3St86f7PDxNWrAPOGFgsp6kLJIE1/3NTBoCDtsZKy ta4qZlplhpH8IQqAWveDpOMk+PduZ4c1PUVTATm1ufOfXKF3pkxmwvvDnmdz179XxRvi MvLg== X-Gm-Message-State: AOJu0YxS0ZxqGAdQLoGoc/tskKsMHzrmJwXCGnZKTAC1HVHRvCIlM0aL MveqqX7zugR3K1/GLQNFNDhZ5FzKdmLuSwFJfNQmxhfPqBvLcC1Y4ejah3S3X6nC5QH7jnos0Tg ZBxIWsDxs9JBiR0FtBSHBYUlLMlPbg9I= X-Gm-Gg: ASbGncvloDvzCjSUmoWxrzGGqYnS0gDhpudZsgZ+vAnsIQ3uW0+oNBd6ukA39tGzfJ2 Y8IO3DL52JuRai2OvYe0KpWGzF1h2VRhCYCPzj3Ur+15JIcYdcnBa3xGj2VEeoGE/BFuNDvD4z4 ZWzELVnreffMxjTrAy7NPOn+ZXO4Pzw5RIWAQc9ydHVwUQgcA3EQwaI80eD254L+QFcVTY7r7T3 Mjq X-Google-Smtp-Source: AGHT+IE/LRuZsbs9mImUdyrShXeAUPFY5rTeN7MPazexRplG/FDZwisbdnt4ou3r8o3qGU7nCCPd5NG4Woqhm6gFB6o= X-Received: by 2002:a05:6102:54a8:b0:4fc:670:fbf with SMTP id ada2fe7eead31-5060e5f8e4fmr657105137.18.1754632234632; Thu, 07 Aug 2025 22:50:34 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: px shi Date: Fri, 8 Aug 2025 13:50:19 +0800 X-Gm-Features: Ac12FXzC1P9C_JNZz-ws2OZ1DXK747LSmJJQ_8VPsY7bFb1OxbKycJpb_XmPaIo Message-ID: Subject: Re: Questions about the continuity of WAL archiving To: Adrian Klaver Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000000e893a063bd42749" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000000e893a063bd42749 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 =E4=BA=8E2025=E5=B9=B48=E6=9C=888= =E6=97=A5=E5=91=A8=E4=BA=94 12:25=E5=86=99=E9=81=93=EF=BC=9A > On 8/7/25 20:20, px shi wrote: > > Hi, > > There is a scenario: the current timeline of the PostgreSQL primary nod= e > > is 1, and the latest WAL file is 100. The standby node has also receive= d > > 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 > adrian.klaver@aklaver.com > --0000000000000e893a063bd42749 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you for your reply.=C2=A0
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.=C2=A0
Additionally, if ther= e'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 <<= a href=3D"mailto:adrian.klaver@aklaver.com">adrian.klaver@aklaver.com&g= t; =E4=BA=8E2025=E5=B9=B48=E6=9C=888=E6=97=A5=E5=91=A8=E4=BA=94 12:25=E5=86= =99=E9=81=93=EF=BC=9A
On 8/7/25 20:20, px shi wro= te:
> Hi,
> There is a scenario: the current timeline of the PostgreSQL primary no= de
> is 1, and the latest WAL file is 100. The standby node has also receiv= ed
> 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 b= e
> 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
adrian.klave= r@aklaver.com
--0000000000000e893a063bd42749--