pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Tighten asserts on ParallelWorkerNumber 6+ messages / 1 participants [nested] [flat]
* pgsql: Tighten asserts on ParallelWorkerNumber @ 2026-03-14 14:48 Tomas Vondra <tomas.vondra@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Tomas Vondra @ 2026-03-14 14:48 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Tighten asserts on ParallelWorkerNumber The comment about ParallelWorkerNumbr in parallel.c says: In parallel workers, it will be set to a value >= 0 and < the number of workers before any user code is invoked; each parallel worker will get a different parallel worker number. However asserts in various places collecting instrumentation allowed (ParallelWorkerNumber == num_workers). That would be a bug, as the value is used as index into an array with num_workers entries. Fixed by adjusting the asserts accordingly. Backpatch to all supported versions. Discussion: https://postgr.es/m/5db067a1-2cdf-4afb-a577-a04f30b69167@vondra.me Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Backpatch-through: 14 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/02eecead8678a9afe6047d42692f752e3ec0639c Modified Files -------------- src/backend/executor/nodeAgg.c | 2 +- src/backend/executor/nodeBitmapHeapscan.c | 2 +- src/backend/executor/nodeBitmapIndexscan.c | 2 +- src/backend/executor/nodeIncrementalSort.c | 2 +- src/backend/executor/nodeIndexonlyscan.c | 2 +- src/backend/executor/nodeIndexscan.c | 2 +- src/backend/executor/nodeMemoize.c | 2 +- src/backend/executor/nodeSort.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Tighten asserts on ParallelWorkerNumber @ 2026-03-14 14:48 Tomas Vondra <tomas.vondra@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Tomas Vondra @ 2026-03-14 14:48 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Tighten asserts on ParallelWorkerNumber The comment about ParallelWorkerNumbr in parallel.c says: In parallel workers, it will be set to a value >= 0 and < the number of workers before any user code is invoked; each parallel worker will get a different parallel worker number. However asserts in various places collecting instrumentation allowed (ParallelWorkerNumber == num_workers). That would be a bug, as the value is used as index into an array with num_workers entries. Fixed by adjusting the asserts accordingly. Backpatch to all supported versions. Discussion: https://postgr.es/m/5db067a1-2cdf-4afb-a577-a04f30b69167@vondra.me Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Backpatch-through: 14 Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/0e5ff9b9b45a657aea12440478dc002e9b01f138 Modified Files -------------- src/backend/executor/nodeAgg.c | 2 +- src/backend/executor/nodeBitmapHeapscan.c | 2 +- src/backend/executor/nodeBitmapIndexscan.c | 2 +- src/backend/executor/nodeIncrementalSort.c | 2 +- src/backend/executor/nodeIndexonlyscan.c | 2 +- src/backend/executor/nodeIndexscan.c | 2 +- src/backend/executor/nodeMemoize.c | 2 +- src/backend/executor/nodeSort.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Tighten asserts on ParallelWorkerNumber @ 2026-03-14 14:48 Tomas Vondra <tomas.vondra@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Tomas Vondra @ 2026-03-14 14:48 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Tighten asserts on ParallelWorkerNumber The comment about ParallelWorkerNumbr in parallel.c says: In parallel workers, it will be set to a value >= 0 and < the number of workers before any user code is invoked; each parallel worker will get a different parallel worker number. However asserts in various places collecting instrumentation allowed (ParallelWorkerNumber == num_workers). That would be a bug, as the value is used as index into an array with num_workers entries. Fixed by adjusting the asserts accordingly. Backpatch to all supported versions. Discussion: https://postgr.es/m/5db067a1-2cdf-4afb-a577-a04f30b69167@vondra.me Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Backpatch-through: 14 Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/2fa42feb7921d9486d56a38608d2b27b8f4e607c Modified Files -------------- src/backend/executor/nodeAgg.c | 2 +- src/backend/executor/nodeIncrementalSort.c | 2 +- src/backend/executor/nodeMemoize.c | 2 +- src/backend/executor/nodeSort.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Tighten asserts on ParallelWorkerNumber @ 2026-03-14 14:48 Tomas Vondra <tomas.vondra@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Tomas Vondra @ 2026-03-14 14:48 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Tighten asserts on ParallelWorkerNumber The comment about ParallelWorkerNumbr in parallel.c says: In parallel workers, it will be set to a value >= 0 and < the number of workers before any user code is invoked; each parallel worker will get a different parallel worker number. However asserts in various places collecting instrumentation allowed (ParallelWorkerNumber == num_workers). That would be a bug, as the value is used as index into an array with num_workers entries. Fixed by adjusting the asserts accordingly. Backpatch to all supported versions. Discussion: https://postgr.es/m/5db067a1-2cdf-4afb-a577-a04f30b69167@vondra.me Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Backpatch-through: 14 Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/6fab4fa541a74414b27bed9c01f6e618e793c7d1 Modified Files -------------- src/backend/executor/nodeAgg.c | 2 +- src/backend/executor/nodeIncrementalSort.c | 2 +- src/backend/executor/nodeMemoize.c | 2 +- src/backend/executor/nodeSort.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Tighten asserts on ParallelWorkerNumber @ 2026-03-14 14:48 Tomas Vondra <tomas.vondra@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Tomas Vondra @ 2026-03-14 14:48 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Tighten asserts on ParallelWorkerNumber The comment about ParallelWorkerNumbr in parallel.c says: In parallel workers, it will be set to a value >= 0 and < the number of workers before any user code is invoked; each parallel worker will get a different parallel worker number. However asserts in various places collecting instrumentation allowed (ParallelWorkerNumber == num_workers). That would be a bug, as the value is used as index into an array with num_workers entries. Fixed by adjusting the asserts accordingly. Backpatch to all supported versions. Discussion: https://postgr.es/m/5db067a1-2cdf-4afb-a577-a04f30b69167@vondra.me Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Backpatch-through: 14 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/34baa313e31788e3a0ba251d5649b6e3ccfced26 Modified Files -------------- src/backend/executor/nodeAgg.c | 2 +- src/backend/executor/nodeIncrementalSort.c | 2 +- src/backend/executor/nodeMemoize.c | 2 +- src/backend/executor/nodeSort.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Tighten asserts on ParallelWorkerNumber @ 2026-03-14 14:48 Tomas Vondra <tomas.vondra@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Tomas Vondra @ 2026-03-14 14:48 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Tighten asserts on ParallelWorkerNumber The comment about ParallelWorkerNumbr in parallel.c says: In parallel workers, it will be set to a value >= 0 and < the number of workers before any user code is invoked; each parallel worker will get a different parallel worker number. However asserts in various places collecting instrumentation allowed (ParallelWorkerNumber == num_workers). That would be a bug, as the value is used as index into an array with num_workers entries. Fixed by adjusting the asserts accordingly. Backpatch to all supported versions. Discussion: https://postgr.es/m/5db067a1-2cdf-4afb-a577-a04f30b69167@vondra.me Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Backpatch-through: 14 Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ff78b8fac46e82dcee0d994dab87e4634c7d7d9b Modified Files -------------- src/backend/executor/nodeAgg.c | 2 +- src/backend/executor/nodeIncrementalSort.c | 2 +- src/backend/executor/nodeMemoize.c | 2 +- src/backend/executor/nodeSort.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2026-03-14 14:48 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-03-14 14:48 pgsql: Tighten asserts on ParallelWorkerNumber Tomas Vondra <tomas.vondra@postgresql.org> 2026-03-14 14:48 pgsql: Tighten asserts on ParallelWorkerNumber Tomas Vondra <tomas.vondra@postgresql.org> 2026-03-14 14:48 pgsql: Tighten asserts on ParallelWorkerNumber Tomas Vondra <tomas.vondra@postgresql.org> 2026-03-14 14:48 pgsql: Tighten asserts on ParallelWorkerNumber Tomas Vondra <tomas.vondra@postgresql.org> 2026-03-14 14:48 pgsql: Tighten asserts on ParallelWorkerNumber Tomas Vondra <tomas.vondra@postgresql.org> 2026-03-14 14:48 pgsql: Tighten asserts on ParallelWorkerNumber Tomas Vondra <tomas.vondra@postgresql.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox