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: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>,
Bertrand Drouvot <bertranddrouvot.pg@gmail.com>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2025-05-19T09:15:56Z
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 Sun, May 18, 2025 at 4:06 PM Dilip Kumar <dilipbalaut@gmail.com> wrote: > > Thanks for proposing the idea of making wal_level configurable at > runtime. But why isn't making the relevant GUCs SIGHUP-reloadable > sufficient? > > For enabling logical replication, users are already familiar with the > wal_level and max_wal_senders settings. The main issue is that > changing them currently requires a server restart. If we can address > that by making the GUCs reloadable via SIGHUP, that might be enough. > Sure, but the challenges are huge. Consider cases like one wants to change wal_level from 'logical' to 'minimal'. See some analysis of the same in email [1]. I think it will be a much bigger and challenging project with diminishing returns as compared to the alternative we are discussing. > On the other hand, if the goal is to make the behavior fully dynamic, > then we should go all the way, decouple it from wal_level. For > example, we could start logging the extra WAL needed for logical > decoding as soon as a logical slot is created, and stop once all > logical slots are dropped, even if wal_level is still set to logical. > Yeah, this is one thing that is still under consideration. It is almost equivalent to removing wal_level as 'logical', which sounds like a compatibility break, and even if we want to do that, it is better to attempt that after the base version is committed and we get a broader consensus on the same. [1]- https://www.postgresql.org/message-id/CAD21AoAA%3DzuiajwXgXSCYQWo%3D6oY-%3DCGLaEqvpfNUTVsLen%2BCA%40mail.gmail.com -- With Regards, Amit Kapila.