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 1ukRmw-002SuY-2l for pgsql-general@arkaria.postgresql.org; Fri, 08 Aug 2025 18:25:58 +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 1ukRmu-00FPo2-EH for pgsql-general@arkaria.postgresql.org; Fri, 08 Aug 2025 18:25:56 +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 1ukRmu-00FPnq-2l for pgsql-general@lists.postgresql.org; Fri, 08 Aug 2025 18:25:56 +0000 Received: from mail-il1-x132.google.com ([2607:f8b0:4864:20::132]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ukRmr-001U8z-1W for pgsql-general@lists.postgresql.org; Fri, 08 Aug 2025 18:25:55 +0000 Received: by mail-il1-x132.google.com with SMTP id e9e14a558f8ab-3e5172e496aso18857805ab.1 for ; Fri, 08 Aug 2025 11:25:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754677551; x=1755282351; 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=Ivs+GU30KNgqIc9SDrWJ67oUXGcPniwe7dP1GJ0f+sM=; b=aOWzpDosW4nv1UzGxNGOMu8Bv3DNklxdiWFwyJ5ZaBFFj6LF1jCKmI6z8feVipGIRB Aswfvyj7MOtZhi5BGvLKcADbZHXkgwMA6Fu9nnJxxoTc5srLiQ/fxtVT7GLl9W6bp+1u Brra6VNRhtZ7LwY5IpSps5pCd3OATdkOzIK5edTI9kMyMA9w9o8AsPoYSojn1zdcytgq Z6FrnH4IN6XsgX5mDdVHyvQAWKdmu2CAT4stMjVs7v7Ek4Y4DkP7dRGN8hxXMaiObxiN dyctLKs2nY9byci+b5oq4JsFCngOaTEEFs21fkYqnOlkDThembK8LVog8KiWbZkJOTqS 99gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754677551; x=1755282351; 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=Ivs+GU30KNgqIc9SDrWJ67oUXGcPniwe7dP1GJ0f+sM=; b=ZOrztfsZynE350nPwv2REktiz4MxdKoaUx5sIiB47KTtUj7sN71P+u9SB0AxdIgRp/ rVfnGzH75UskUj2dhZwt65ro/j/9ufMO2ypOC8wHzAs+lfLVS3e8MxqeQuW68FMirif+ 5Pm+7MSQyQm975x3SyJ5iHvon9VfQEhyLspZn4sxaBSoVY6MtbFvhLgnaVG7I8R6kpBN acgF5q258X7RwPDkGw6BKjd74Y42KVc1jmSV9qruu2Yt7hZRJQpsbAgQe/jeHU7vW3Ep ziReKHKuf5QzAiVJGfAVyYbVWwCTsWhbn2ZeiZhO6Cr7lOJriyde/uGaOEM/orp+ESeU KHsA== X-Gm-Message-State: AOJu0YxwXhFZOJzLmeE1G5TYjmQIR6A2c7S/LIHG6vIsWMfPaZ6lywvT 3J5aGjSYIdVUUKDlXiHpwBOtXt9xCnFOWJiLqtZSxIEQdTub/RpbWEZl8Q5wqNn4iKuNlYHifgZ VJEK2cKH/4S/blj09LaLLFC8j/9qf/d3imzyl X-Gm-Gg: ASbGnctkdoUfeStvxYNO5XHuYPLoc4hmDB8UnCVSyiGSBdTDyU62WKfe7sPuAT6FByM 41Rf6nkMmbQs75l99IcDWOxgZnXBgQlFjVxmIAJWo7bJ6jBZi5krv6wxTKokNWaIwxl+eIjJJxx xeIOXSlComMjC+lxvwL+TON9FsVDf/Dwm1yXOiK8F5d836rFVd+TMPCumNHJVc5fv8o5JQ0+rXD 4pHJa+xnGdBUXXN0XyCc/4X4gyKa/p21cgQIfqOCZ20NiysaT8= X-Google-Smtp-Source: AGHT+IEKi1jWFWF7UeyeUEDTiP6kTyjlJ1nUeMxJkEfYn2H0H3f0R28LF0BjGTNWktl0iCSPwl+KM249/pXF4PhtWKU= X-Received: by 2002:a05:6e02:3e90:b0:3e3:ee9c:725e with SMTP id e9e14a558f8ab-3e532f0a66dmr61755525ab.0.1754677551291; Fri, 08 Aug 2025 11:25:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Greg Sabino Mullane Date: Fri, 8 Aug 2025 14:25:13 -0400 X-Gm-Features: Ac12FXzkUHYUfipSYsrGFA2BmLI6ujk0ggUfujja9hFr51L0PK2zsmF3LcyKs0U Message-ID: Subject: Re: Questions about the continuity of WAL archiving To: px shi Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000023eb98063bdeb4b4" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000023eb98063bdeb4b4 Content-Type: text/plain; charset="UTF-8" > > 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? > I'm still not clear on what the problem here is, other than your archiving not keeping up. The best solution to that is: https://pgbackrest.org/1/configuration.html#section-archive/option-archive-async Yes, you would lost some ability for easy PITR for 80-100, but could still be done by resurrecting your crashed primary, or carefully grabbing from the replica before they get recycled. You can set archive_mode=always on the replicas to help with this. Cheers, Greg -- Crunchy Data - https://www.crunchydata.com Enterprise Postgres Software Products & Tech Support --00000000000023eb98063bdeb4b4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
There is a s= cenario: 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 1= 00. However, the latest WAL file archived is only file 80. If the primary n= ode crashes at this point and the standby is promoted to the new primary, a= rchiving will resume from file 100 on timeline 2. As a result, WAL files fr= om 81 to 100 on timeline 1 will be missing from the archive.
Is there a = good solution to prevent this situation?

<= /div>
I'm still not clear on what the problem here is, other than y= our archiving not keeping up. The best solution to that is:

<= /div>

Yes, you wou= ld lost some ability for easy PITR for 80-100, but could still be done by r= esurrecting your crashed primary, or carefully grabbing from the replica be= fore they get recycled. You can set archive_mode=3Dalways on the replicas t= o help with this.
=C2=A0
Cheers,
Greg

--
Enterprise Po= stgres Software Products & Tech Support

--00000000000023eb98063bdeb4b4--