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: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, Amit Kapila <amit.kapila16@gmail.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.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>
Date: 2025-09-25T11:57:09Z
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 Tue, Sep 23, 2025 at 3:28 AM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
>
>
> I've attached the updated patch. It incorporates all comments I got so
> far and implements to lazily disable logical decoding. It's used only
> when the process tries to disable logical decoding during process
> exit.
>

I am resuming the review now. I agree with the discussion of lazily
disabling logical decoding on ERROR or process-exit for temp-slot.

Few  initial comments:

1)
I see that on standby too, during proc-exit, we set 'pending_disable'.
But it never resets it, as DisableLogicalDecodingIfNecessary is no-op
on standby. And thus the checkpoint keeps on attempting to reset it
everytime. Do we even need to set it on standby?

Logfile has repeated: 'start completing pending logical decoding
disable request'

2)
+ ereport(LOG,
+ (errmsg("skip disabling logical decoding as during process exit")));

'as' not needed.

thanks
Shveta