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 1qshS0-00903W-BW for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Oct 2023 10:37:24 +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 1qshRw-008nUe-S8 for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Oct 2023 10:37:21 +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 1qshRw-008nU8-GX for pgsql-hackers@lists.postgresql.org; Tue, 17 Oct 2023 10:37:21 +0000 Received: from mail-oo1-xc2a.google.com ([2607:f8b0:4864:20::c2a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qshRt-001A2F-8Y for pgsql-hackers@lists.postgresql.org; Tue, 17 Oct 2023 10:37:20 +0000 Received: by mail-oo1-xc2a.google.com with SMTP id 006d021491bc7-57de3096e25so1147427eaf.1 for ; Tue, 17 Oct 2023 03:37:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697539037; x=1698143837; 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=ECi6SnMSN8NYOZIpCukeVABrZ//sO4qASZ8Agwcz+eQ=; b=UoCwyJNhDKnlCHcIxYC30vHU1QPf3ArpGGgBHpeKyY83GhfPqNv5vLYSo8rYcZFrqs 0KIabBogTQRanif02yt87MP6iAyMVhgma2p5VAld5/Gdunl5Vb3BJ0wc3lJgCdZTVKHt T4wlIKpLxs+CjaTWgwf0eWhanRC8Sr2gkw4M9bQgomFxJHe33TVh87KIRxk7NJ/MEHzG uLfLIRJ6sUd7MFxIEiAvpouOjiaVmCZb1euFgfgkYIYLdRpQi4NQdqVdCrioz9Savgqr AeRN/wBp8hJ8LBTzCXonDnS5mZhfg6mxCrhgmKMHFjtgjJNY28kz0o1PFlN0czJFoYQ0 ykBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697539037; x=1698143837; 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=ECi6SnMSN8NYOZIpCukeVABrZ//sO4qASZ8Agwcz+eQ=; b=jPWblH1SlOK3cFCKNFk3P34kvw/kr7flSBZr1fmTcmQgZe1DJSHJOaRKTlxh3nW5kV TqnPofdw0eb+OkV2fxQgCwI5+cEbAEs3UP4mhuPNYCHqYLvLHrklIlalPP0HqkeDtlbI T+jL/PEZSBfc83O+07VuiIh+ERyjabpWhSHLBd6YbI9V0qzgXsmSH8XLZwPlD6cH7lm3 Zr7FD5LzGN3jRtLgRWP8loKts8MyjN85OJ23JQc0nu+g51WmuYhSGsVq354s3z/m8WkF QGUaZZh4yRwM2c5gax5W6K41UbQTd9yTcP+ycQ6RkLSoBiPk7aS1DDhJM8ftwT+Pz7rZ TuiQ== X-Gm-Message-State: AOJu0YwoSgG10P8kBUALOWF9MwIA33fgcQTB2snniW/CWwirk9xbNUDj 6u/AFgSqluOyxfheIX8XtAjIZwdBZZN4WyeszhZYxGgSBGs= X-Google-Smtp-Source: AGHT+IFJxgtin9gso2XumFoTbFEddDRZlaByNnpu4UUlCDOqjnyfVIwMo5YSRS6y629wKJlF03M9hN4I5KppgZJoTcg= X-Received: by 2002:a05:6870:8a28:b0:1e1:e6ee:94b6 with SMTP id p40-20020a0568708a2800b001e1e6ee94b6mr2261497oaq.4.1697539036735; Tue, 17 Oct 2023 03:37:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Fabrice Chapuis Date: Tue, 17 Oct 2023 12:37:05 +0200 Message-ID: Subject: Re: wal recycling problem To: Christoph Moench-Tegeder Cc: PostgreSQL Hackers Content-Type: multipart/alternative; boundary="00000000000046eca90607e71b46" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000046eca90607e71b46 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for your feedback > How would you know which part of WAL is needed for any specific replication slot? change are captured for each published table and written twice, once in the current wal and once in the slot-specific wal > How would you handle multiple replications for the same table added information about from which publication a table belongs is entered in the wal slot > be it logical or physical replication, retains WAL up to max_slot_wal_keep_size ok but if max_slot_wal_keep_size is exceeded the changes are lost and all of the replicated tables must be resynchronized Regards Fabrice On Sun, Oct 8, 2023 at 3:57=E2=80=AFPM Christoph Moench-Tegeder wrote: > ## Fabrice Chapuis (fabrice636861@gmail.com): > > > From a conceptual point of view I think that specific wals per > subscription > > should be used and stored in the pg_replslot folder in order to avoid > > working directly on the wals of the instance. > > What do you think about this proposal? > > I think that would open a wholly new can of worms. > The most obvious point here is: that WAL is primarily generated for > the operation of the database itself - it's our kind of transaction > log, or "Redo Log" in other systems' lingo. Replication (be it physical > or logical) is a secondary purpose (an obvious and important one, but > still secondary). > How would you know which part of WAL is needed for any specific > replication slot? You'd have to decode and filter it, and already > you're back at square one. How would you handle multiple replications > for the same table (in the same publication, or even over multiple > (overlapping) publications) - do you multiply the WAL? > > For now, we have "any replication using replication slots, be it logical > or physical replication, retains WAL up to max_slot_wal_keep_size > (or "unlimited" if not set - and on PostgreSQL 12 and before); and you > need to monitor the state of your replication slots", which is a > totally usabe rule, I think. > > Regards, > Christoph > > -- > Spare Space > --00000000000046eca90607e71b46 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks for your feedback
> How would you k= now which part of WAL is needed for any specific
replication slot?
=
change are captured for each published table and written twice,=C2=A0 = once in the current wal and once in the slot-specific wal
> Ho= w would you handle multiple replications
for the same table=C2=A0
added information about from which publication a table be= longs is entered in the wal slot
> be it logic= al or physical replication, retains WAL up to max_slot_wal_keep_size
<= /div>
ok but if max_slot_wal_keep_size is exceeded the changes are lost= and all of the replicated tables must be resynchronized

Regards

Fabrice

On Sun, Oct 8, 2023 at 3:57=E2=80=AFPM Christoph Moench-Teg= eder <cmt@burggraben.net> w= rote:
## Fabrice= Chapuis (fabr= ice636861@gmail.com):

> From a conceptual point of view I think that specific wals per subscri= ption
> should be used and stored in the pg_replslot folder in order to avoid<= br> > working directly on the wals of the instance.
> What do you think about this proposal?

I think that would open a wholly new can of worms.
The most obvious point here is: that WAL is primarily generated for
the operation of the database itself - it's our kind of transaction
log, or "Redo Log" in other systems' lingo. Replication (be i= t physical
or logical) is a secondary purpose (an obvious and important one, but
still secondary).
How would you know which part of WAL is needed for any specific
replication slot? You'd have to decode and filter it, and already
you're back at square one. How would you handle multiple replications for the same table (in the same publication, or even over multiple
(overlapping) publications) - do you multiply the WAL?

For now, we have "any replication using replication slots, be it logic= al
or physical replication, retains WAL up to max_slot_wal_keep_size
(or "unlimited" if not set - and on PostgreSQL 12 and before); an= d you
need to monitor the state of your replication slots", which is a
totally usabe rule, I think.

Regards,
Christoph

--
Spare Space
--00000000000046eca90607e71b46--