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 1ulkSL-004y8F-9b for pgsql-general@arkaria.postgresql.org; Tue, 12 Aug 2025 08:34:05 +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 1ulkSJ-006A3G-Kt for pgsql-general@arkaria.postgresql.org; Tue, 12 Aug 2025 08:34:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ulkSJ-006A37-6I for pgsql-general@lists.postgresql.org; Tue, 12 Aug 2025 08:34:03 +0000 Received: from mail-vs1-xe35.google.com ([2607:f8b0:4864:20::e35]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ulkSG-0009sd-2x for pgsql-general@lists.postgresql.org; Tue, 12 Aug 2025 08:34:02 +0000 Received: by mail-vs1-xe35.google.com with SMTP id ada2fe7eead31-4fe7712bedaso4875099137.1 for ; Tue, 12 Aug 2025 01:34:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754987640; x=1755592440; 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=e6hwC+wfaWnFbOpBK7MSvz3XhunGhED5wB5brZA1Qa0=; b=eMotGzaKlW9Pv5cVq4C1JTLhB41urj1RDjtyAI4DLKhVnsLimVWJq/2N5fV6XlnxDc kLxymTHQTxLHTNUqH6lIYlD4732XBt1clGlWSPXJ056BU0py71Anvwq1D7yZ6UC0iVCG HpB7O0cbqAwVE4TSDyAOMKIaIFoiP4ulEV6uX5Wsi32BPL3/iqP8Ofmbk00B035TPcIK bhzXNRLK1juT6VFX77s0b3elrRBYsL2pMBycLoLm2YCBrXpiwE5HxPp1XPNFGNiG07ea CAuq5g9+s3kq5RB/++Pt2rWjAbtWmdz6qm/XkdEvr2l+8dLHjCANrlykYiBiU8qb8lGy D/4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754987640; x=1755592440; 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=e6hwC+wfaWnFbOpBK7MSvz3XhunGhED5wB5brZA1Qa0=; b=VruUN3zwWZtQRUt3AcHS8PKWKj3Dr+12GQp9XPk8kq/ffPhuLFrpPXcJ0xmdJVbw7P POEG96g9w1vQpRsu+vQWkKFUEwOPkIbu5AHWLRgMxE/pMSLDXFoybA3jPiNhdayb2fQg omrSmZLwHiZOOO6Oc5n+7jYwBLjTYCmYe4WqWKw8VwQSLQcwMAeTmK33gxKkIv/uxlfA WRJs8RTefKZmSwTPEaVvJsXEMwbWNHfP5G4hkncM7Sxdy5USMWVfgqUUcnJiDgo560gI jqq0EWnYSM+lj36/a63y0r84Oune7bwXnCHvfNiNSmHEvUkHIWCYZySJN882SqQmK/WW Hxsw== X-Gm-Message-State: AOJu0Yx/ZL8BNvyHdXCoH5oOiUdIe1BP2qZeZjFTSZ8rqHqn1kuZlPwh NoUZYaAvX0Me/hwr4J2TDgOEFN/GHcNS3WBAUGgHCtynsbn/GjiXdvw8Do1DFd/BD7OAcn9S4I1 4+7zVAikUek+8jg4A1LrpdQnIPQYXc2Ps1sTJkLXnMWcU X-Gm-Gg: ASbGncvh93fAE0jvh5zvAIvM9+v+1L4LglyFiut6h9QZooEVU3nF9+7nG3W8t7QObQe AY6ITSAHWJ3Z9FjxmS3O16ZJ2M6s+XXBT5i9hpuL3KGvMowaNBq7pk1HhODDC/nAAi13Mvku3Vh WBCXYwn0VN61+7RFOxQMzT27U6IL8A/5eTIJxd2aZB1KcvptMhoAqvutEU4o5I/YVHN0ivpC3LO KFdhMnTDAobOeCtsyksL+5TN3Z+VoSYc1tdmTcc X-Google-Smtp-Source: AGHT+IHYd5Ns9FZT/PBtEIQf40rWxF0hESfKMzIgQAIsity5J8hVDFk+zLWry9yV5v/tBoNWXFR5zm8IvaUCmiSO87I= X-Received: by 2002:a05:6102:2910:b0:4fd:5c41:bfbf with SMTP id ada2fe7eead31-50cbd4cbfdcmr1171314137.7.1754987640400; Tue, 12 Aug 2025 01:34:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: px shi Date: Tue, 12 Aug 2025 16:33:48 +0800 X-Gm-Features: Ac12FXwmkVUP_yrGSIx0S42VKojcm2aMXRPYfGRT-O5porw4luh3O4hG5MUgAGk Message-ID: Subject: Re: Questions about the continuity of WAL archiving To: Greg Sabino Mullane Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000e42e35063c26e66c" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000e42e35063c26e66c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > > I'm still not clear on what the problem here is, other than your archivin= g > not keeping up. In my scenario, archive_mode is not set to always on the replicas, it may cause interruptions in the archived WAL logs. You can set archive_mode=3Dalways on the replicas to help with this. Yes, it can work. And I would like to know if this is the recommended configuration for production use? Greg Sabino Mullane =E4=BA=8E2025=E5=B9=B48=E6=9C=889= =E6=97=A5=E5=91=A8=E5=85=AD 02:25=E5=86=99=E9=81=93=EF=BC=9A > 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. > > Cheers, > Greg > > -- > Crunchy Data - https://www.crunchydata.com > Enterprise Postgres Software Products & Tech Support > > --000000000000e42e35063c26e66c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm still not clear on what the probl= em here is, other than your archiving not keeping up.
=C2= =A0In my scenario, archive_mode is not set to always on the replicas,=C2=A0= it may cause interruptions in the archived WAL logs.

You can set archive_mode=3Dalways on the replicas to hel= p with this.
Yes, it can work. And I would like to know if= this is the recommended configuration for production use?

<= div class=3D"gmail_quote gmail_quote_container">
Greg Sabino Mullane <ht= amfids@gmail.com> =E4=BA=8E2025=E5=B9=B48=E6=9C=889=E6=97=A5=E5=91= =A8=E5=85=AD 02:25=E5=86=99=E9=81=93=EF=BC=9A
=
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 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 t= he new primary, archiving will resume from file 100 on timeline 2. As a res= ult, WAL files from 81 to 100 on timeline 1 will be missing from the archiv= e.
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://pgba= ckrest.org/1/configuration.html#section-archive/option-archive-async

Yes, you would lost some ability for easy PITR for 8= 0-100, but could still be done by resurrecting your crashed primary, or car= efully grabbing from the replica before they get recycled. You can set arch= ive_mode=3Dalways on the replicas to help with this.
=C2=A0
=
Chee= rs,
Greg

--
Enterprise Postgres Software Products & Tech Supp= ort

--000000000000e42e35063c26e66c--