pgsql: Add REPACK progress phases for logical decoding setup.

From: Masahiko Sawada <msawada(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add REPACK progress phases for logical decoding setup.
Date: 2026-11-02 23:01:26
Message-ID: E1xO11q-00000001rCs-3kQI@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add REPACK progress phases for logical decoding setup.

Previously, REPACK (CONCURRENTLY) reported everything it did before the
heap scan as "initializing", including enabling logical decoding and
setting up the logical decoding context. Setting up the context waits
for the transactions that have a transaction ID assigned to end and
therefore can take arbitrarily long, but users couldn't tell that wait
apart from the rest of the setup.

Add two phases, "enabling logical decoding" and "initializing logical
decoding". As these steps run in the decoding worker, the worker tells
the backend running REPACK which phase to report through shared
memory, and the backend reports it while waiting for the worker.

Bump catalog version.

Author: Sami Imseih <samimseih(dot)pg(at)gmail(dot)com>
Reviewed-by: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Reviewed-by: Manu <manuelreyesbravo(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAN12%2BYJOeOyPYB5JS28VE_%2Brzg%3DRbzQXfj58TGfMYwv-TX9mJA%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/51ae21aa313bb6b79ad914920279cd0d89e92220

Modified Files
--------------
doc/src/sgml/monitoring.sgml | 38 +++++++++++++++++++++++-----------
src/backend/catalog/system_views.sql | 2 ++
src/backend/commands/repack.c | 12 +++++++++++
src/backend/commands/repack_worker.c | 28 ++++++++++++++++++++++---
src/include/catalog/catversion.h | 2 +-
src/include/commands/progress.h | 2 ++
src/include/commands/repack_internal.h | 7 +++++++
src/test/regress/expected/rules.out | 2 ++
8 files changed, 77 insertions(+), 16 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2026-11-03 00:11:26 pgsql: Delay checkpoint start while creating a multixact
Previous Message Tomas Vondra 2026-11-02 22:41:52 pgsql: Fix BRIN minmax-multi distance calculation for OID