Re: POC: enable logical decoding when wal_level = 'replica' without a server restart

shveta malik <shveta.malik@gmail.com>

From: shveta malik <shveta.malik@gmail.com>
To: Sawada Masahiko <sawada.mshk@gmail.com>
Cc: Peter Smith <smithpb2250@gmail.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, Shlok Kyal <shlok.kyal.oss@gmail.com>, Bertrand Drouvot <bertranddrouvot.pg@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>, shveta malik <shveta.malik@gmail.com>, Amit Kapila <amit.kapila16@gmail.com>
Date: 2025-12-10T10:07:35Z
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 →
  1. Fix regression test failure when wal_level is set to minimal.

  2. Toggle logical decoding dynamically based on logical slot presence.

  3. Disallow server start with sync_replication_slots = on and wal_level < logical.

Another thing I noticed in v34 is that, due to the change in
show_effective_wal_level(), a standby now reports effective_wal_level
= 'logical' when wal_level = 'logical' is set on the standby, even if
the primary has effective_wal_level='replica'. Is this change in
behavior intentional?

It seems to contradict the documented behavior as well:

+        On standby servers, <varname>effective_wal_level</varname> matches
+        the value of <varname>effective_wal_level</varname> from the most
+        upstream server in the replication chain.

~~

I see that XLogLogicalInfoXactCache is removed, but it is still
referenced at few places:

+extern PGDLLEXPORT int XLogLogicalInfoXactCache;

+/*
+ * A process local cache of LogicalDecodingCtl->xlog_logical_info. This is
+ * initialized at process startup time, and could be updated when absorbing
+ * the process barrier signal in ProcessBarrierUpdateXLogLogicalInfo().
+ * See the comments of XLogLogicalInfoXactCache too for details of how this
+ * cache value is used within a transaction.
+ */

thanks
Shveta