Re: POC: enable logical decoding when wal_level = 'replica' without a server restart
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: shveta malik <shveta.malik@gmail.com>
Cc: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>,
Masahiko Sawada <sawada.mshk@gmail.com>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2025-07-21T06:28:05Z
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 Mon, Jul 21, 2025 at 10:48 AM shveta malik <shveta.malik@gmail.com> wrote: > > On Fri, Jul 18, 2025 at 3:03 PM Amit Kapila <amit.kapila16@gmail.com> wrote: > > > > > > > > One concern I have is regarding the default setting of > > > 'force_slot_drop' . I assume the default value of this new DROP-SUB > > > argument will be 'false' to prevent customers from inadvertently > > > dropping the last slot on the publisher. But, would this be > > > acceptable, considering that users may have DROP-SUBSCRIPTION commands > > > in their scripts which would suddenly stop dropping slot now? > > > > > > > That would only happen when users use this new idea of enabling > > wal_level to 'logical' on the fly. I think the users having existing > > setups with pub-sub would have kept the default wal_level to 'logical' > > on publisher. > > > > Okay, but then we will have to avoid doing the enhancement of getting > rid of wal_level='logical' as suggested in [1]. > > Even if we do so, I am not very much convinced for this argument and its value. > --The value of ''force_slot_drop" will hold its meaning only in a > conditional scenario. Assuming default is false, then it will still > drop the slots until it is last slot and wal_level < logical on > primary. This behavior can seem a bit unintuitive or confusing from > the user's perspective. > --If the user is trying to actually retain the slot by giving > force_slot_drop=false , then how are we going to track that i.e. > distinguish from its default. > > Bertrand has proposed a similar design in [2]. We can revisit that as well once. > I am slightly hesitant to introduce multiple ways to enable logical decoding/replication unless that is the only path as giving multiple options to achieve the same thing can confuse users as to which one is preferable and pros/cons of each. -- With Regards, Amit Kapila.