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 1sG042-008EgR-4c for pgsql-general@arkaria.postgresql.org; Sat, 08 Jun 2024 17:41:15 +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 1sG03y-000T8C-P7 for pgsql-general@arkaria.postgresql.org; Sat, 08 Jun 2024 17:41:11 +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 1sG03y-000T4H-85 for pgsql-general@lists.postgresql.org; Sat, 08 Jun 2024 17:41:11 +0000 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sG03s-000Lr8-54 for pgsql-general@lists.postgresql.org; Sat, 08 Jun 2024 17:41:09 +0000 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a6f0c3d0792so63662966b.3 for ; Sat, 08 Jun 2024 10:41:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717868462; x=1718473262; 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=/tUu+YAgvg5Ak7DLWZ04Xj9a6m0KD93IMajGzdA9FL8=; b=aeZTUhl/MGH74DsLAUM0W/6vFbi8R8SH8SpcMydW3wq9eWPcr9+GKc1Q8mo197x5cH sAM30ywxTnxwglAt+aMCGlSZ0vjTbXF3qvwkDkr6VH9LA3mAauUilEsvUBAf2voy6F7L Cvya64YF+YuoYIna3B2HP2ifQGjzifQDLdjpuhLwy4WsFAnuSGjTN15FGsyLMZqGHzHI OAFGtGsaHRfLUFo4PtkIwz8m5sQrSBagvBnI7knpf81qmQxLlAq1hShRnutv92y76kun 1CllILUGkZvX9cs3foj1SO+S+wx5ztQ6U/6ZLXraRhsbiqzq9qWZ5w21G/PfOzzyKwoD biRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717868462; x=1718473262; 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=/tUu+YAgvg5Ak7DLWZ04Xj9a6m0KD93IMajGzdA9FL8=; b=S+EgBNbLTpVik9bdB4qHO7OhFwTzNhzRWzqJThZhJ1YGG/lUSZHHmd6RnAFlwYD8jH x2PCg1ZFjQcAkTd38dItk/0vh+StpCBBvxYFuhXAPcd8gYHvEgZHGbctaOQ0PtonJxZC pQRJzkmb1nU9Ogj+cwP3AeSGZWs/s/62vPZu8an6a1nf7CVyxNEfldN3Ca4zXHhUoLN0 ychacu7PAUA0NBDMx9FVUBo7zpJi+B7pi83YQZ0ZmhYID0wkgup5SZFzW30m3asUFFYS pRaW97JnjdCTvmRZIh/VKR7UJpOHXEKM7SuAyUcI0ltBtL9GBUj3jbsuV1R+BYiZPz1Q vd0w== X-Gm-Message-State: AOJu0Yx85ojhplWjHIPwfkb5FozG72AHQyWuXtkFV+0+PWAsP0bs2vNo WccFfxnj8U086vYwM9GTNJu3oiRQ9eAd/shGrBtq/cOCZGGP7uan/Ef44BipmTrymvNLL+J8PeF iLEhKzdRpyt6hTmFIjqpRs3BSsJM= X-Google-Smtp-Source: AGHT+IHlG8E2IS8pDdCsr5z6GtxVovL9+077iXAwyKDCQ9pgORVhuXAVXuAJH3lghtA29K20VjZH2hWczC1iPNEQJ0g= X-Received: by 2002:a17:906:a2c8:b0:a6f:1045:d5de with SMTP id a640c23a62f3a-a6f1045d664mr57079166b.11.1717868461786; Sat, 08 Jun 2024 10:41:01 -0700 (PDT) MIME-Version: 1.0 References: <1628637f-419f-4f6a-9cb6-07af90cd0bc4@aklaver.com> <1c0273f5-a90a-48f6-b51f-fe15c16fa1c6@aklaver.com> <490e8a5c-f1f5-40fe-8243-f1c8c18d03f2@aklaver.com> In-Reply-To: <490e8a5c-f1f5-40fe-8243-f1c8c18d03f2@aklaver.com> From: Koen De Groote Date: Sat, 8 Jun 2024 19:40:50 +0200 Message-ID: Subject: Re: Questions on logical replication To: Adrian Klaver Cc: PostgreSQL General Content-Type: multipart/alternative; boundary="0000000000006f8ebf061a646ba0" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000006f8ebf061a646ba0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable What I'm trying to do is upgrade a PG11 database to PG16, using logical replication. The PG11 has an active and a standby, there are a handful of databases. On particular one has a few tables just over 100GB, then a few 100 tables near 1GB. What I'd do is start a publication with no tables and add them 1 at a time, refreshing subscription each time. This might take a long time, so my main questions relate to potential network issues or various situations where the instance receiving the logical replication, suddenly stop being able to receive. Resyncing, and the effects of WAL buildup, are my main concern. Accidentally sent a mail to only your email, sorry for that. Regards, Koen De Groote On Fri, Jun 7, 2024 at 5:15=E2=80=AFPM Adrian Klaver wrote: > On 6/6/24 15:19, Koen De Groote wrote: > > I'll give them a read, though it might take a few weekends > > > > Meanwhile, this seems to be what I'm looking for: > > > > From > > > https://www.postgresql.org/docs/current/warm-standby.html#STREAMING-REPLI= CATION-SLOTS > < > https://www.postgresql.org/docs/current/warm-standby.html#STREAMING-REPLI= CATION-SLOTS > > > > > > " Replication slots provide an automated way to ensure that the primary > > does not remove WAL segments until they have been received by all > > standbys, and that the primary does not remove rows which could cause a > > recovery conflict > > < > https://www.postgresql.org/docs/current/hot-standby.html#HOT-STANDBY-CONF= LICT> > even when the standby is disconnected." > > > > I'm reading that as: "if there is a replication slot, if the standby is > > disconnected, WAL is kept" > > > > And if we know WAL is kept in the "pg_wal" directory, that sounds like > > it could slowly but surely fill up disk space. > > > > > > But again, I'll give them a read. I've read all of logical replication > > already, and I feel like I didn't get my answer there. > > It would be a good idea to provide an a fairly specific outline of what > you are trying to achieve, then it would be easier for folks to offer > suggestions on what to do or not to do. > > > > > Thanks for the help > > > > > > Regards, > > Koen De Groote > > -- > Adrian Klaver > adrian.klaver@aklaver.com > > --0000000000006f8ebf061a646ba0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
What I'm trying to do is upgrade a PG11 database = to PG16, using logical replication.

The PG11 has an active and a standby, there are a handful of databases. On=20 particular one has a few tables just over 100GB, then a few 100 tables=20 near 1GB.

What I'd do is start a publication w= ith no tables and add them 1 at a time, refreshing subscription each time.<= /div>

This might take a long time, so my main questions relate to potential=20 network issues or various situations where the instance receiving the=20 logical replication, suddenly stop being able to receive.

Resyncing, and the effects of WAL buildup, are my main concern.

Accidentally sent a mail to only your email, sorry fo= r that.

Regards,
Koen De Groote

On Fri, Jun 7, 2024 at 5:15=E2=80=AFPM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 6/6/24 15:19, Koen = De Groote wrote:
> I'll give them a read, though it might take a few weekends
>
> Meanwhile, this seems to be what I'm looking for:
>
>=C2=A0 From
> https://ww= w.postgresql.org/docs/current/warm-standby.html#STREAMING-REPLICATION-SLOTS= <https:= //www.postgresql.org/docs/current/warm-standby.html#STREAMING-REPLICATION-S= LOTS>
>
> " Replication slots provide an automated way to ensure that the p= rimary
> does not remove WAL segments until they have been received by all
> standbys, and that the primary does not remove rows which could cause = a
> recovery conflict
> <https://www.po= stgresql.org/docs/current/hot-standby.html#HOT-STANDBY-CONFLICT> eve= n when the standby is disconnected."
>
> I'm reading that as: "if there is a replication slot, if the = standby is
> disconnected, WAL is kept"
>
> And if we know WAL is kept in the "pg_wal" directory, that s= ounds like
> it could slowly but surely fill up disk space.
>
>
> But again, I'll give them a read. I've read all of logical rep= lication
> already, and I feel like I didn't get my answer there.

It would be a good idea to provide an a fairly specific outline of what you are trying to achieve, then it would be easier for folks to offer
suggestions on what to do or not to do.

>
> Thanks for the help
>
>
> Regards,
> Koen De Groote

--
Adrian Klaver
adrian.klave= r@aklaver.com

--0000000000006f8ebf061a646ba0--