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 <[email protected]>
Reviewed-by: Álvaro Herrera <[email protected]>
Discussion: 
https://postgr.es/m/CAHGQGwFUsrBvTurkSU8TEc=dztunqteuxrasseqnmt7ambz...@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(+)

Reply via email to