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 1ukS5g-002XJZ-84 for pgsql-general@arkaria.postgresql.org; Fri, 08 Aug 2025 18:45:20 +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 1ukS5e-00FYWM-Bs for pgsql-general@arkaria.postgresql.org; Fri, 08 Aug 2025 18:45:18 +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 1ukS5d-00FYWD-V6 for pgsql-general@lists.postgresql.org; Fri, 08 Aug 2025 18:45:18 +0000 Received: from mail-oi1-x232.google.com ([2607:f8b0:4864:20::232]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ukS5b-001UH8-0q for pgsql-general@lists.postgresql.org; Fri, 08 Aug 2025 18:45:17 +0000 Received: by mail-oi1-x232.google.com with SMTP id 5614622812f47-43590a0e89aso575141b6e.1 for ; Fri, 08 Aug 2025 11:45:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754678713; x=1755283513; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=B+y2Py5mBR2ODJdGthYQQWMXU5zQHggVSQ6U66t/+4o=; b=OAOPen9PnT+s3MGTDUnyrum1Cg54dYVrG8FM1VORsNCvK2mczho6gBf1Tbha/J1Pzp 2IVtLvZqdNEKc939ydz6Ye8w/ZJL5m6DPaKBiszX8YMdJfZqe2LDP3ap1WYQa9u2+GBF ssRcCBIzYFaU3CTtRafwpT+Xg2xfTUqIgK0Bk4yVzMQbSOJG/oj46BmdFTz4SGaSlhOe x1qQoVbvX4ZmVOZLtdgFM2Z5mwXuCpFkpMK2ynQJtfgUSceIlOV38ccuXJy7dimBBiiX EvxXkK6J0hjrtYdNgI0HqPT50s4Hue79uW4bkQakPxIex7/w176vgMyO1KxgxLEBHOSi PeYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754678713; x=1755283513; h=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=B+y2Py5mBR2ODJdGthYQQWMXU5zQHggVSQ6U66t/+4o=; b=FfXhPzNeXPQSkLeA9WTTw5Fj7hDx/QZh5l+qtW65lanLJr9FXtuvVNOsQ/eACP8ecE nTgvkpF2HBffxnm8br0bdNYJWdo3aQqMtYfqqFm1X5D+8EsHQlp3qOjPk8IkoOFipbxg uOZbxYnfvQitVJQbxReTQ4qEaSFaZtjaaChl8wR25UwiKk+oXaYXIqiSjYpTxTChjHmz jmOOAphsjuCP5Nw2XSsAwsY3YwJGyUifa+majO3whKTMNdj495dYtzo+/Q8f2888Y1/H l+ke7q9K+pVe6zTjdloL+VJOZPdsL7NMVpt/cRGPO1+z32hV2v6hOy1PXaGs8GQgFQBs PK7Q== X-Gm-Message-State: AOJu0YzfoUgkEjHauYpcnjIKVmkZwRdMPeZO6LEWB9l1fmanHpA3Axh4 N/RVOPeJoBsiqbwxnt0shU8FZhnPkcSTOX0KIsP3nRgqrHDW9RxX7CD6LhaBtFpjwLqFDEV6mE7 aVMK5ckBDAEK1ulnLjH1vdSgw7iXCwzK5S5m0 X-Gm-Gg: ASbGnct7ceeDQefawDTTvTY/MPWRaFZTG7F7zEs3pt9UMKep6cflG8/HFZQNSEfXWC/ 8Bh9C/JtFz5vWzQpFlPmYr5EIIaWW9xoOkBWVRoGHqnppQFNG/uyb2L7lBCQS5nJay+zL/MyM1I 7EhrEUCzBKqt93ExgfxYgy01ESwvsspTUoj4sbCrC3HG0MyLH13B8ucQrtjVy6nQEbNbaY7rCJQ GuYLpuk X-Google-Smtp-Source: AGHT+IEJvSRsnaT9+GvHhwxlnHFkPFHOj2OTjDeTjj5rwu1+zCfByEOFFFP4VYX0fKmPBijMS+JCatFHusTXL3EMqfI= X-Received: by 2002:a05:6808:6f82:b0:41c:4f7:1929 with SMTP id 5614622812f47-43597d289c5mr2605995b6e.21.1754678712952; Fri, 08 Aug 2025 11:45:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ron Johnson Date: Fri, 8 Aug 2025 14:45:02 -0400 X-Gm-Features: Ac12FXxvoFFyH2WUegtPVr9vsXoaamMvoFINKaKKqpouC4waqeCBBFuAWJa6EXo Message-ID: Subject: Re: Questions about the continuity of WAL archiving To: "pgsql-generallists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000616ca7063bdef917" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000616ca7063bdef917 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Aug 8, 2025 at 2:26=E2=80=AFPM Greg Sabino Mullane wrote: > 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 th= e >> 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 archivin= g > not keeping up. The best solution to that is: > > > https://pgbackrest.org/1/configuration.html#section-archive/option-archiv= e-async > > Yes, you would lost some ability for easy PITR for 80-100, but could stil= l > be done by resurrecting your crashed primary, or carefully grabbing from > the replica before they get recycled. You can set archive_mode=3Dalways o= n > the replicas to help with this. > Bog-standard PgBackRest retains all WAL files required for a full backup set and its associated differential/incremental backups, no? I've certainly done more than one --type=3Dtime --target=3D"${RestoreUntil}" res= tore without giving a second thought to timelines or whether the WAL exists. Maybe I've just ignored the problem, since it (seemingly) does everything for PITR backups. --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --000000000000616ca7063bdef917 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Aug 8, 2025 at 2:26=E2=80=AFPM Gr= eg Sabino Mullane <htamfids@gmail.= com> wrote:
There is a scenario: the current timeline of the PostgreSQL p= rimary 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 prom= oted 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 t= he archive.
Is there a good solution to prevent this situation?

I'm still not clear on what the pro= blem here is, other than your archiving not keeping up. The best solution t= o that is:


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

Bog-standard PgBackRe= st retains all WAL files required for a full backup set and its associated = differential/incremental backups, no?=C2=A0 I've certainly done more th= an one=C2=A0--type=3Dtime --target=3D"${RestoreUntil}" restore wi= thout giving a second thought to timelines or whether the WAL exists.
=

Maybe I've just ignored the problem, since it (seem= ingly) does everything for PITR backups.=C2=A0

--
Death to <Redacted>, and butter sauce.<= div>Don't boil me, I'm still alive.
<Redacted> l= obster!
--000000000000616ca7063bdef917--