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

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: shveta malik <shveta(dot)malik(at)gmail(dot)com>
Cc: Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>, Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: POC: enable logical decoding when wal_level = 'replica' without a server restart
Date: 2025-10-28 10:29:47
Message-ID: CAA4eK1+FhSC2VaRBK0BaL-cNMcau97yADT=kR9R8cQKucqS9fw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 27, 2025 at 8:38 PM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
>
> On Mon, Oct 27, 2025 at 6:12 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> >
>
> > Another related point is that, say we decide to disable decoding
> > because the last logical slot got invalidated and
> > RequestDisableLogicalDecoding()->LogicalDecodingStatusChangeAllowed()
> > returns false, then how the disabling will happen?
> >
>
> If LogicalDecodingStatusChangeAllowed() returns false, we do not
> disable logical decoding because that essentially means
> recovery-in-progress and if that is the case, we do not allow
> status-change. LogicalDecodingStatusChangeAllowed() returns false
> always on standby until it is promoted and recovery ends.
>

But the request will be lost and we won't be able to disable decoding
after promotion. Won't it be better if RequestDisableLogicalDecoding()
always set pending_disable as true and later
checkpointer->DisableLogicalDecodingIfNecessary() anyway takes care of
it by calling LogicalDecodingStatusChangeAllowed()? That way the
request to disable decoding won't be lost.

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2025-10-28 10:31:23 Re: Bug in pg_stat_statements
Previous Message Amit Kapila 2025-10-28 10:03:48 Re: Logical Replication of sequences