Re: POC: enable logical decoding when wal_level = 'replica' without a server restart
Masahiko Sawada <sawada.mshk@gmail.com>
From: Masahiko Sawada <sawada.mshk@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: shveta malik <shveta.malik@gmail.com>,
Bertrand Drouvot <bertranddrouvot.pg@gmail.com>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2025-07-17T18:55:54Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix regression test failure when wal_level is set to minimal.
- 0de5f0d869d1 19 (unreleased) landed
-
Toggle logical decoding dynamically based on logical slot presence.
- 67c20979ce72 19 (unreleased) landed
-
Disallow server start with sync_replication_slots = on and wal_level < logical.
- 12da45742cfd 19 (unreleased) cited
On Thu, Jul 17, 2025 at 2:36 AM Amit Kapila <amit.kapila16@gmail.com> wrote: > > What if we make DROP SUBSCRIPTION fail if it can lead to removal of > the last slot on publisher and allow DROP to succeed when the > subscription's drop_slot_force (a new subscription option) is set? > Now, users can still be allowed to Drop the subscription, if it > disassociates the subscription from the slot by using method explained > in docs [1] (See Notes section). Similarly when a user is trying to > drop the last logical slot via pg_drop_replication_slot, we will allow > it only with the force option. This should ensure that the user is > aware of the consequences of dropping the last slot. I think even if we prevent the last logical replication that was used for logical replication from being removed, the primary would continue to accumulate WALs for that slot. I think it actually doesn't need to hold WALs and dead catalog tuples in order to keep the effective WAL level 'logical'. So probably it's better to 'reset' the slot, meaning to clear the last slot's restart_lsn and catalog_xmin? Using such option would work in interactive case but I'm not sure how works in tools like shell scripts. Regards, -- Masahiko Sawada Amazon Web Services: https://aws.amazon.com