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

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(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-05-19 09:15:56
Message-ID: CAA4eK1LkdHUDWQuVZh77cbw-0UYg62BKoTqefhHoYVRHVqMxMw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, May 18, 2025 at 4:06 PM Dilip Kumar <dilipbalaut(at)gmail(dot)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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2025-05-19 09:43:19 Re: Backward movement of confirmed_flush resulting in data duplication.
Previous Message Amit Kapila 2025-05-19 09:05:08 Re: POC: enable logical decoding when wal_level = 'replica' without a server restart