From 6125a57528451fb954e18cde65569ff1312d3273 Mon Sep 17 00:00:00 2001 From: Fujii Masao Date: Wed, 9 Sep 2026 18:11:07 +0900 Subject: [PATCH v2 2/2] 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. Backpatch-through: 19 --- src/backend/commands/repack.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c index 57f28f1a420..9abe76a4815 100644 --- a/src/backend/commands/repack.c +++ b/src/backend/commands/repack.c @@ -3479,6 +3479,8 @@ build_new_indexes(Relation NewHeap, Relation OldHeap, List *OldIndexes) result = lappend_oid(result, newindex); index_close(ind, NoLock); + + pgstat_progress_incr_param(PROGRESS_REPACK_INDEX_REBUILD_COUNT, 1); } return result; -- 2.55.0