pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Masahiko Sawada <msawada@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add REPACK progress phases for logical decoding setup.
Date: Mon, 02 Nov 2026 23:01:26 +0000
Message-ID: <E1xO11q-00000001rCs-3kQI@gemulon.postgresql.org> (raw)

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.pg@gmail.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Manu <manuelreyesbravo@gmail.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(-)



Message-ID: <E1xO11q-00000001rCs-3kQI@gemulon.postgresql.org>
Permalink:  ../E1xO11q-00000001rCs-3kQI@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xO11q-00000001rCs-3kQI@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: msawada@postgresql.org
  Subject: Re: pgsql: Add REPACK progress phases for logical decoding setup.
  In-Reply-To: <E1xO11q-00000001rCs-3kQI@gemulon.postgresql.org>
  References: <E1xO11q-00000001rCs-3kQI@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox