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: shveta malik <shveta.malik@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>, Amit Kapila <amit.kapila16@gmail.com>
Date: 2025-12-10T10:24:04Z
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.

On Wed, Dec 10, 2025 at 2:07 AM shveta malik <shveta.malik@gmail.com> wrote:
>
> 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.

No, it should be fixed. Thank you for pointing this out.

> ~~
>
> 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.
> + */

Will fix.

Regards,

-- 
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com