pgsql: Disable logical decoding after REPACK (CONCURRENTLY)

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Disable logical decoding after REPACK (CONCURRENTLY)
Date: 2026-05-27 18:14:40
Message-ID: E1wSIm8-001NOT-1v@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Disable logical decoding after REPACK (CONCURRENTLY)

REPACK (CONCURRENTLY) uses a temporary logical replication slot, which
is dropped once done, but it wasn't calling RequestDisableLogicalDecoding(),
leaving effective_wal_level stuck at 'logical'.

Fix by adding a Boolean flag to ReplicationSlotDropAcquired() to have it
request to disable logical decoding, and passing it as true on REPACK.
Other callers of that function preserve their existing behavior.

Author: Imran Zaheer <imran(dot)zhir(at)gmail(dot)com>
Reviewed-by: shveta malik <shveta(dot)malik(at)gmail(dot)com>
Discussion: https://postgr.es/m/CA+UBfaktds57dw2M8BEv_kS-=ixph3w+3MxKixtaDQMi_k7Ybg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2af1dc89282bea681201cf66e2bb32537294e623

Modified Files
--------------
src/backend/commands/repack_worker.c | 2 +-
src/backend/replication/logical/launcher.c | 3 +-
src/backend/replication/logical/slotsync.c | 10 ++++--
src/backend/replication/slot.c | 48 +++++++++++---------------
src/include/replication/slot.h | 2 +-
src/test/recovery/t/051_effective_wal_level.pl | 14 ++++++++
6 files changed, 47 insertions(+), 32 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Alexander Korotkov 2026-05-27 20:08:41 Re: pgsql: Disable logical decoding after REPACK (CONCURRENTLY)
Previous Message Tom Lane 2026-05-27 16:23:56 pgsql: Fix NOTIFY wakeups for pre-commit LISTEN entries.