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 1sHRLt-007UaZ-9S for pgsql-general@arkaria.postgresql.org; Wed, 12 Jun 2024 17:01:38 +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 1sHRLr-0031i9-N6 for pgsql-general@arkaria.postgresql.org; Wed, 12 Jun 2024 17:01:36 +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 1sHRLr-0031h1-Cc for pgsql-general@lists.postgresql.org; Wed, 12 Jun 2024 17:01:36 +0000 Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sHRLq-001JOH-42 for pgsql-general@lists.postgresql.org; Wed, 12 Jun 2024 17:01:35 +0000 Received: by mail-io1-xd36.google.com with SMTP id ca18e2360f4ac-7eba486df76so3570839f.0 for ; Wed, 12 Jun 2024 10:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718211692; x=1718816492; 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=bW+KG2WDAgAEybRjf8s2Z0sAE5aJFzyIu1gaJ4lxCd8=; b=M+AuMml7qdp2m+64PAvK/kwHw8oN43oUc18zkKEtZUzPpE0b0d2hfBEHpubA88ZC/m 91rAlC/M7jnhjCigRKG0GutaE8ru0Q+P5vRxPIjc4Fpf3BDZhIP4n+tnZ7nReDFwB/Ds vrqLI1KZWRMyTBWxff0Exub+7m6/llShUt1hoL7UYAaW7LjyioxOLivQRZZUdr4NgsNe 1+A/tCaTbfWgpZjmqFotL/4JIZNQf3DN5uyLh8QfVdlfEoPTZtA4KfaQfhP7nWFsSAtW 3473u1bn2H1Wq1TUEleldQ06YNx6Vxp1ZmDVCGPTQsvX68tsTXmtcNAnK8YjH8Aq3J/l 3Qpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718211692; x=1718816492; 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=bW+KG2WDAgAEybRjf8s2Z0sAE5aJFzyIu1gaJ4lxCd8=; b=OxgPSZ+efSIFaQ3axW4uwcH8TuTN0CL0un7g+U9k2D3QCSkXN5NIzCWkyuY6qbdFOY 1OovSakyB1GKvIDtbT5ZJ3wa9hlS9epmv/fbfdA8kX+Xr9uK+rn0yAcKbz31g0kDZZMw x8KDAQkSeE26aR/fOtBiCbzYvHry/+Z4M4XYQtC/vqrh2BfDmD8LiR1XVLjFDpMEStdx h4gpB0u3+OUxtsULFlmug5HtYrPiALqGK/LappTvgR8i8jsvHB4m4nBagC1InyZY9yBO toiR0BDEhXxR3smkGcXrq/1Ok01DAN8uCccQpQ5tGrS46WuP2C9XRgge8S0Ngm0M6gMT AOCA== X-Forwarded-Encrypted: i=1; AJvYcCXuODfMTCxxG5TipqzxjNddBo+M2YG7aaEG1i6WcAyk72nqU58vaJCikHR2VORcvHji7mwCU6Oc33P73czVWpCt8SzquYvzaYCh5oupKSMC+Dvs X-Gm-Message-State: AOJu0Ywm0Pez5BxfZuwCdfvbwrqEagtR4QJJbtspSbbTI7Z92hKPp5SY 4dFHspCNLNN+SgxQ7Zct63MT3JfS8cvltMbVDtbrJbQdPQzdjLGGM9ph469+OCw2+aIjHxVOlCW 6TxnYUzGNQElk38Sfl00Gw/FdMS4= X-Google-Smtp-Source: AGHT+IHGrkuV+OGgtpWQK1qH7XkYSU2FUt60YbbVj12L8n7ZZNWAtcLfeHHZ8pZFqrbFOz03DKw4LANTTAJHq6ZHn4I= X-Received: by 2002:a05:6602:168d:b0:7eb:b63b:3473 with SMTP id ca18e2360f4ac-7ebd8dc8a54mr23276439f.1.1718211692194; Wed, 12 Jun 2024 10:01:32 -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: From: Justin Date: Wed, 12 Jun 2024 13:01:20 -0400 Message-ID: Subject: Re: Questions on logical replication To: Koen De Groote , "pgsql-generallists.postgresql.org" , Adrian Klaver Content-Type: multipart/alternative; boundary="0000000000008ff832061ab455b5" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000008ff832061ab455b5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jun 11, 2024 at 5:43=E2=80=AFPM Koen De Groote = wrote: > > If there are any errors during the replay of WAL such as missing indexe= s > for Replica Identities during an Update or Delete this will cause the ma= in > subscriber worker slot on the publisher to start backing up WAL files > > And also if the connection breaks, from what I understand, is that > correct? Anything that stops the subscription, including disabling the > subscription, is that right? > Yes to all.... > > I suggest confirming all tables have replica identities or primary keys > before going any further. > > Yes, I am aware of this. I made me a small script that prints which table= s > I have added to the publication and are done syncing, and which are > currently not being replicated. > > > > With PG 11 avoid REPLICA IDENTITY FULL as this causes full table scan o= n > the subscriber for PG 15 and earlier. > > I'm also aware of this. My plan is to create a publication with no tables= , > and add them 1 by 1, refreshing the subscriber each time. > Why? what benefit does this provide you?? Add all the tables when creating the publication and be done with it... I get this when trying to understand how this all works on test boxes, but for production NO idea what you're trying to accomplish > I'm not planning on using "REPLICA IDENTITY FULL" anywhere. > Good --0000000000008ff832061ab455b5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Tue, Jun 11, 2024 at 5:43=E2=80=AF= PM Koen De Groote <kdg.dev@gmail.co= m> wrote:
>=20 If there are any errors during the replay of WAL such as missing=20 indexes for Replica Identities during an Update or Delete=C2=A0 this will= =20 cause the main subscriber worker slot on the publisher to start backing=20 up WAL files

And also if the connection break= s, from what I understand, is that correct? Anything that stops the subscri= ption, including disabling the subscription, is that right?
=C2=A0
Yes to all....=C2=A0


>=20 I suggest confirming all tables have replica identities or primary keys bef= ore going any further.

Yes, I am aware of thi= s. I made me a small script that prints which tables I have added to the pu= blication and are done syncing, and which are currently not being replicate= d.
=C2=A0

> With PG 11 avoid REPLICA IDENTITY FULL as this causes full table scan on th= e subscriber for PG 15 and earlier.

I'm a= lso aware of this. My plan is to create a publication with no tables, and a= dd them 1 by 1, refreshing the subscriber each time.
=C2=A0
Why?=C2=A0 what benefit=C2=A0does this provide you?= ?=C2=A0 =C2=A0Add all the tables when creating the publication and be done = with it...=C2=A0 I get this when trying to understand how this all works on= test boxes, but for production NO idea what you're trying to accomplis= h=C2=A0


I'm not planning on using "= ;REPLICA IDENTITY FULL" anywhere.
Goo= d=C2=A0
--0000000000008ff832061ab455b5--