public inbox for [email protected]help / color / mirror / Atom feed
pgsql: reindexdb: Fix the index-level REINDEX with multiple jobs 2+ messages / 1 participants [nested] [flat]
* pgsql: reindexdb: Fix the index-level REINDEX with multiple jobs @ 2025-03-16 11:34 Alexander Korotkov <[email protected]> 0 siblings, 0 replies; 2+ messages in thread From: Alexander Korotkov @ 2025-03-16 11:34 UTC (permalink / raw) To: [email protected] reindexdb: Fix the index-level REINDEX with multiple jobs 47f99a407d introduced a parallel index-level REINDEX. The code was written assuming that running run_reindex_command() with 'async == true' can schedule a number of queries for a connection. That's not true, and the second query sent using run_reindex_command() will wait for the completion of the previous one. This commit fixes that by putting REINDEX commands for the same table into a single query. Also, this commit removes the 'async' argument from run_reindex_command(), as only its call always passes 'async == true'. Reported-by: Álvaro Herrera <[email protected]> Discussion: https://postgr.es/m/202503071820.j25zn3lo4hvn%40alvherre.pgsql Reviewed-by: Álvaro Herrera <[email protected]> Backpatch-through: 17 Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/09ef2f8df1cd746d711ffd916bdd2e9526c51b65 Modified Files -------------- src/bin/scripts/reindexdb.c | 135 ++++++++++++++++++++++++-------------------- 1 file changed, 73 insertions(+), 62 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: reindexdb: Fix the index-level REINDEX with multiple jobs @ 2025-03-16 11:34 Alexander Korotkov <[email protected]> 0 siblings, 0 replies; 2+ messages in thread From: Alexander Korotkov @ 2025-03-16 11:34 UTC (permalink / raw) To: [email protected] reindexdb: Fix the index-level REINDEX with multiple jobs 47f99a407d introduced a parallel index-level REINDEX. The code was written assuming that running run_reindex_command() with 'async == true' can schedule a number of queries for a connection. That's not true, and the second query sent using run_reindex_command() will wait for the completion of the previous one. This commit fixes that by putting REINDEX commands for the same table into a single query. Also, this commit removes the 'async' argument from run_reindex_command(), as only its call always passes 'async == true'. Reported-by: Álvaro Herrera <[email protected]> Discussion: https://postgr.es/m/202503071820.j25zn3lo4hvn%40alvherre.pgsql Reviewed-by: Álvaro Herrera <[email protected]> Backpatch-through: 17 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/682c5be25c28192c56e9d5e2a9ca14673a2fcf4b Modified Files -------------- src/bin/scripts/reindexdb.c | 135 ++++++++++++++++++++++++-------------------- 1 file changed, 73 insertions(+), 62 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2025-03-16 11:34 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2025-03-16 11:34 pgsql: reindexdb: Fix the index-level REINDEX with multiple jobs Alexander Korotkov <[email protected]> 2025-03-16 11:34 pgsql: reindexdb: Fix the index-level REINDEX with multiple jobs Alexander Korotkov <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox