From dacd39c1fd9583a6592b8ffb7e5f616e4a05c069 Mon Sep 17 00:00:00 2001 From: Shihao Zhong Date: Wed, 16 Sep 2026 21:56:16 -0400 Subject: [PATCH v7 3/4] Add an injection point in the per index vacuum loop current_index_relid in pg_stat_progress_vacuum is set and reset around each index, so a test that polls the view can miss it entirely. Add an injection point just after the value is set, so a test can stop with a known index in progress. --- src/backend/access/heap/vacuumlazy.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/backend/access/heap/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c index 44a7466def4..14e85e55077 100644 --- a/src/backend/access/heap/vacuumlazy.c +++ b/src/backend/access/heap/vacuumlazy.c @@ -3057,6 +3057,15 @@ lazy_vacuum_one_index(Relation indrel, IndexBulkDeleteResult *istat, pgstat_progress_update_param(PROGRESS_VACUUM_CURRENT_INDEX_RELID, (int64) RelationGetRelid(indrel)); +#ifdef USE_INJECTION_POINTS + + /* + * Used by tests to inspect pg_stat_progress_vacuum while a known index + * is in progress. + */ + INJECTION_POINT("vacuum-index-in-progress", NULL); +#endif + /* * Update error traceback information. * -- 2.37.1 (Apple Git-137.1)