pgsql: Fix index rebuild progress reporting for REPACK (CONCURRENTLY)

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix index rebuild progress reporting for REPACK (CONCURRENTLY)
Date: 2026-09-16 09:40:03
Message-ID: E1x6m7X-00000000ZEF-2HlR@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix index rebuild progress reporting for REPACK (CONCURRENTLY)

Previously, during REPACK (CONCURRENTLY), index_rebuild_count in
pg_stat_progress_repack and pg_stat_progress_cluster did not advance
as indexes were rebuilt. This made it impossible for users monitoring the
operation to tell how many indexes had been completed.

Fix this by incrementing the count after each index is built on the new
heap, so that both views report the number of completed index builds.

Author: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Reviewed-by: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Discussion: https://postgr.es/m/CAHGQGwFUsrBvTurkSU8TEc=DZTunqteUXrasseqNMT7AMBZKRw@mail.gmail.com
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0765b48874a3fcabadfcaa493d068ec6507e7fc7

Modified Files
--------------
src/backend/commands/repack.c | 2 ++
1 file changed, 2 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2026-09-16 09:40:17 pgsql: Suppress progress reporting when creating TOAST indexes
Previous Message Daniel Gustafsson 2026-09-16 09:06:38 pgsql: Revert online data checksum transitions