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 1sEd4S-002cK4-66 for pgsql-general@arkaria.postgresql.org; Tue, 04 Jun 2024 22:56:01 +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 1sEd4S-0032VT-6Z for pgsql-general@arkaria.postgresql.org; Tue, 04 Jun 2024 22:56:00 +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 1sEd4R-0032VJ-Oo for pgsql-general@lists.postgresql.org; Tue, 04 Jun 2024 22:55:59 +0000 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sEd4O-0001eP-Nx for pgsql-general@lists.postgresql.org; Tue, 04 Jun 2024 22:55:59 +0000 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-57a20c600a7so6941049a12.3 for ; Tue, 04 Jun 2024 15:55:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717541755; x=1718146555; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=nIeZ8cfhaHPYikBQB1za47zqbBBcTo4gXuiPDZFGkWE=; b=Otmyqh/8elzZqlGb6kz9N/sKjMG8d+kraCFwzKhGqG8pKygn58n/v1on4ni161fxFL lAaXxifx/FpUAjHPX4u0c99KG5l5tbfzkcnVkPab+s6MaGdBaB1q+aJn0bo7fTVmWCMD SL2aXuZ87yjn1ogg/4yDtn2EHVPsyf/0BRwzTNjerZEE97goacsgWfQOtpFx0cJCy2lU 8MI/q+mHVC8nf39SiyYD0vGWKnVBmGFt2Yg06Uwlf4yWb1kk3kjVvjQ0YbYoFKp6TSK9 EkW0zB/5Jp270zptGSGoV4jYLWGzOpv4sHVBNwMwM09lCvFv3Boq+yrAbanglXTNbmZA bY2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717541755; x=1718146555; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=nIeZ8cfhaHPYikBQB1za47zqbBBcTo4gXuiPDZFGkWE=; b=ILUg6bWooyR9Sl+mmGPeeaZ01dhcgz/wIgN6mXGyOT+2nee4yIKgljBcu1xDeXhhmn cZ6zfCTdZaf6+Ol/WshP0dnmQ8axNdxlA8BH7e2IrifaoaBZ5Cxj8Gd+SfzjmS0rCbc3 Uq9zlzwJBJ1mWAFywumc4YK/1Qdpaoailu9yjKyLKv6PNr/iXspecto8nWnhp5TVL4VU T1v5dvr/WYdDw+oT1xCw3V5+IsMnoqTpfq9/Y23hU4gNZ24/j/Ho3+LQxmh92Wrnd9Rp rpQp5rG0kQe1yjHXveTZa+C29f6DlPx1TL49hM89Zrd9ZX8YkEtoKmdrRq9JXHhu1jxp 8Jyg== X-Gm-Message-State: AOJu0YyQAdnS06zT+8o82h6ZZQIQc6tnZOJe0CgpJkLosBi1SKUedKVY Ca3R3xL2gvmh6rob0giugxVig8Axwjxo2tKsHomIEMRC2kB/a+E9ineVBxqZQqiK654iAYLmyaX sjnY0+jqqMlw6NSjLj3RCBUpPm7ex7G7t X-Google-Smtp-Source: AGHT+IFY0EM/x+S9sn53sIzYX2G+A2LCxbgt3lc4zjVz9he2Oo3YGRcLkYm2fKNskPJJwXwt5I0Jo4e+mi2OGa+/McY= X-Received: by 2002:a17:906:e2c8:b0:a68:6f16:cf1a with SMTP id a640c23a62f3a-a699fdfde4dmr48822966b.72.1717541754479; Tue, 04 Jun 2024 15:55:54 -0700 (PDT) MIME-Version: 1.0 From: Koen De Groote Date: Wed, 5 Jun 2024 00:55:42 +0200 Message-ID: Subject: Questions on logical replication To: PostgreSQL General Content-Type: multipart/alternative; boundary="00000000000029aba3061a185a7d" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000029aba3061a185a7d Content-Type: text/plain; charset="UTF-8" I recently read the entire documentation on logical replication, but am left with a question on the buildup of WAL On this page: https://www.postgresql.org/docs/current/logical-replication-subscription.html#LOGICAL-REPLICATION-SUBSCRIPTION-SLOT It is written: " When dropping a subscription, the remote host is not reachable. In that case, disassociate the slot from the subscription using ALTER SUBSCRIPTION before attempting to drop the subscription. If the remote database instance no longer exists, no further action is then necessary. If, however, the remote database instance is just unreachable, the replication slot (and any still remaining table synchronization slots) should then be dropped manually; otherwise it/they would continue to reserve WAL and might eventually cause the disk to fill up. Such cases should be carefully investigated." Assuming a situation where I add tables 1 at a time to the publisher, and refresh the subscription every time. What happens if I shut down the subscriber database for a while? The subscription isn't dropped, so am I reading it right that the disk on the publisher will slowly be filling up with WAL? Isn't that always the case if wall is enabled? This "cause disk to fill up" warning is quite concerning, and I'd like to understand what could cause it and how likely it is? I thought logical replication uses WAL by default, so doesn't that mean there has to be a log of changes kept anyhow? Even if the WAL isn't written to disk by an "archive_command"? Regards, Koen De Groote --00000000000029aba3061a185a7d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I recently read the entire documentation on logical r= eplication, but am left with a question on the buildup of WAL

I= t is written: " When dropping a subscription, the remote host is not reachable. In that cas= e, disassociate the slot from the subscription using ALTER SUBSCRIPTION before attempting to drop the subscription. If the remote database=20 instance no longer exists, no further action is then necessary. If,=20 however, the remote database instance is just unreachable, the=20 replication slot (and any still remaining table synchronization slots)=20 should then be dropped manually; otherwise it/they would continue to=20 reserve WAL and might eventually cause the disk to fill up. Such cases=20 should be carefully investigated."


=
Assuming a situation where I add tables 1 at a time to the publisher, = and refresh the subscription every time.

What happ= ens if I shut down the subscriber database for a while? The subscription is= n't dropped, so am I reading it right that the disk on the publisher wi= ll slowly be filling up with WAL? Isn't that always the case if wall is= enabled?

This "cause disk to fill up" w= arning is quite concerning, and I'd like to understand what could cause= it and how likely it is? I thought logical replication uses WAL by default= , so doesn't that mean there has to be a log of changes kept anyhow? Ev= en if the WAL isn't written to disk by an "archive_command"?<= /div>

Regards,
Koen De Groote
--00000000000029aba3061a185a7d--