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.96) (envelope-from ) id 1vR9q7-0082nI-2N for pgsql-general@arkaria.postgresql.org; Thu, 04 Dec 2025 13:57:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vR9q6-002pzF-28 for pgsql-general@arkaria.postgresql.org; Thu, 04 Dec 2025 13:57:46 +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.96) (envelope-from ) id 1vR9q6-002pz7-0y for pgsql-general@lists.postgresql.org; Thu, 04 Dec 2025 13:57:46 +0000 Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vR9q4-0036vl-26 for pgsql-general@lists.postgresql.org; Thu, 04 Dec 2025 13:57:46 +0000 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-3ece54945d9so334010fac.0 for ; Thu, 04 Dec 2025 05:57:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764856662; x=1765461462; 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=lk2srBYPU22hVO6HXypFFoYa5GgO/7glp5SADgoguPM=; b=UpqKMcawkYfxXKtM3t3vOecdZ/5bWpyw2TCIeY/s5Wkeo3dtcuusb+C9u5nK0qpwz/ 98tzuSzGwhnnb3Yz8upKvKSR4GIkH7GpKstzpQOw7xObdzN4UClbeIYj6yjhQVNoOs51 hroI5gM5omiJqnyb4YISZu5Xi38IqdQwmff+P0cObDlzUwWgBqZfAUNuDBZ+338vP4j8 /czIB3PEfo0YwLb50T6n1bOl1GYvfK+8F5sVWb38mk3kWu4vSGJojgcT+gvbaNFMVMEx 1jtpbf1JCOMKBN8jX3z8bFZuIdPK206sAIf6EjRtFOZF7nA1Puh2WqRLzHvw0XWDO0ub 6tbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764856662; x=1765461462; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lk2srBYPU22hVO6HXypFFoYa5GgO/7glp5SADgoguPM=; b=Fs+klOIU623po4inrxa6NMAsc28DBbhkm+wwXaoTohi/LkMjiE/msY+tCjOh12gCNm m8Y3ZQgOwqGJKedLaRUutU9J9R/e1IPFz3ZxQIOUEyRyQMWsG+yL2RlUO14JtKKHuYLm 1s5sF1aGfmdGKnUbv2CShaMdwYC7K3l8Bwh9cE1Q3vL7d3XfgTgmEUoNcZKAfB+fyQv1 zv6NxHNh9F8xJDOqfk0w/ZtlBKM0CrXBFgQ9dPYCxtFMubsIhXhGDJsBIs7Nj0d1lDbC SVPRGrKelkLIj++yWYO9uWAWxft3Zdcw9rJ/lIkRd+LOolsI/J5gzIVrQU+4lXrnK+pw cM4w== X-Gm-Message-State: AOJu0YyLak7bXqr5vt1aya2dEQyGrZ/BiiSvSR9QRbvBe4uybF9cxHh/ wCI10aqmWciFCDDF2XXG+3W8WfpIwbzVZgioLEUjOdZlNWzvqvcTcE7uW0ejvCuUzsVnQzZKE/+ 8//J53sz45OhWe2C/jFYoHh0LRhkR83l9FQ== X-Gm-Gg: ASbGnctG5zSws4Wu6PGaIkGyw+x+WRq4EY25M3wHqi33SBXFTq4o6Lg72X1EfN7eteZ I6FJ67rHAmF6jReoSaWZrDAfLjjy5GfAWVgQM8oedt3P6HiAEmuG2yE1BTXvVJpR7DdB+TG0Z0y hkDuSqM8S3G4HFLwhJtyd9yK2UxRgi+c8brHbtgIPNMnGhOqK7v+g3Y/IConThakU7BiX8ou5VU Un/WF4RZ+ff537+yzWSLfgXU9JH5BhNCUZHTVFJ4mh+ClNOjsZVom5VGZ1M/UXHE73BGcNx X-Google-Smtp-Source: AGHT+IFpVcH2T5XTqbXEyZwVRUsZcrc+XrIaLhgUosjH2ahMVo7sf1B4bxDbNlfZu2li801MHZ7jGGFR7rZRrVfpKL4= X-Received: by 2002:a05:6870:450b:b0:3e8:8e57:a79d with SMTP id 586e51a60fabf-3f169493bfcmr3581480fac.52.1764856661883; Thu, 04 Dec 2025 05:57:41 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Ron Johnson Date: Thu, 4 Dec 2025 08:57:30 -0500 X-Gm-Features: AQt7F2qD3i7t0_mmi9TEtjYoKY3010stWxqFJ_v00n-BrfrJ8cEnGivxRhjJhlY Message-ID: Subject: Re: Upgrade Failover Cluster To: "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000693eb6064520b6e4" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000693eb6064520b6e4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Dec 4, 2025 at 2:00=E2=80=AFAM BUBACZ Martin wrote: > Hi All, > > > > I=E2=80=99m fairly new to postgresql and I have a question concerning upg= rading a > 2 node failover physical replication cluster. I=E2=80=99m automating the = cluster > installation and maintenance by using Puppet. All runs good so far. > > > > When it comes to an upgrade scenario, let=E2=80=99s say upgrading from re= l. 16.x > to 17.x, I=E2=80=99m unsure if it is required to upgrade primary first an= d then > replica or if order doesn=E2=80=99t matter. I=E2=80=99ve read different s= tatements in some > articles on internet about it. One said it=E2=80=99s possible to upgrade = replica > first by using pg_upgrade or rebuilding replica from primary by > pg_basebackup and others are telling me primary first. > > > > What is the recommended/most stable path to upgrade a cluster? I would > appreciate if you could shed some light on this? Thanks beforehand. > One standard low-downtime practice is:to do *logical* replication from the Primary to the Secondary. Then promote the Secondary to be the New Primary, and do a pg_basebackup from it back to the Old Primary. The other low- (but not as low) downtime method is to stop replication, and pg_upgrade the Primary. (It's fast with the --link option, but there's no going back once you start the upgraded instance.) Then pg_basebackup to the Secondary as normal. Last is to stop replication and then do a normal pg_upgrade. It's still fast, but copies all data to a new directory, but that "fast" is relative to how big your data is. Which you choose depends on how much downtime you can get and (since LR doesn't replicate DDL and sequences) how often the DDL changes. --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --000000000000693eb6064520b6e4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Dec 4, 2025 at 2:00=E2=80=AFAM BU= BACZ Martin <martin.bubacz@axa.= com> wrote:

Hi All,

=C2=A0

I=E2=80=99m fairly new to postg= resql and I have a question concerning upgrading a 2 node failover physical= replication cluster. I=E2=80=99m automating the cluster installation and m= aintenance by using Puppet. All runs good so far.

=C2=A0

When it comes to an upgrade sce= nario, let=E2=80=99s say upgrading from rel. 16.x to 17.x, I=E2=80=99m unsu= re if it is required to upgrade primary first and then replica or if order = doesn=E2=80=99t matter. I=E2=80=99ve read different statements in some articles on internet about it. One said it=E2=80=99s possible to upgrade r= eplica first by using pg_upgrade or rebuilding replica from primary by pg_b= asebackup and others are telling me primary first.

=C2=A0

What is the recommended/most st= able path to upgrade a cluster? I would appreciate if you could shed some l= ight on this? Thanks beforehand.

<= div>
One standard low-downtime practice is:to do=C2=A0logi= cal replication from the Primary to the Secondary.=C2=A0 Then promote t= he Secondary to be the New Primary, and do a pg_basebackup from it back to = the Old Primary.

The other low- (but not as low) d= owntime method is to stop replication, and pg_upgrade the Primary.=C2=A0 (I= t's fast with the --link option, but there's no going back once you= start the upgraded instance.)=C2=A0 Then pg_basebackup to the Secondary as= normal.

Last is to stop replication and then do a= normal pg_upgrade.=C2=A0 It's still fast, but copies all data to a new= directory, but that "fast" is relative to how big your data is.<= /div>

Which you choose depends on how much downtime you = can get and (since LR doesn't replicate DDL and sequences) how often th= e DDL changes.
=C2=A0
--
Death to <Redacted>, and butter sauce.
Don't boil me, I= 'm still alive.
<Redacted> lobster!
--000000000000693eb6064520b6e4--