pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Ensure that plpgsql cleans up cleanly during parallel-worker exi 6+ messages / 1 participants [nested] [flat]
* pgsql: Ensure that plpgsql cleans up cleanly during parallel-worker exi @ 2020-03-26 22:07 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2020-03-26 22:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Ensure that plpgsql cleans up cleanly during parallel-worker exit. plpgsql_xact_cb ought to treat events XACT_EVENT_PARALLEL_COMMIT and XACT_EVENT_PARALLEL_ABORT like XACT_EVENT_COMMIT and XACT_EVENT_ABORT respectively, since its goal is to do process-local cleanup. This oversight caused plpgsql's end-of-transaction cleanup to not get done in parallel workers. Since a parallel worker will exit just after the transaction cleanup, the effects of this are limited. I couldn't find any case in the core code with user-visible effects, but perhaps there are some in extensions. In any case it's wrong, so let's fix it before it bites us not after. In passing, add some comments around the handling of expression evaluation resources in DO blocks. There's no live bug there, but it's quite unobvious what's happening; at least I thought so. This isn't related to the other issue, except that I found both things while poking at expression-evaluation performance. Back-patch the plpgsql_xact_cb fix to 9.5 where those event types were introduced, and the DO-block commentary to v11 where DO blocks gained the ability to issue COMMIT/ROLLBACK. Discussion: https://postgr.es/m/10353.1585247879@sss.pgh.pa.us Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/86e5badd22d9ae131a2badb87acdbb20e41811a2 Modified Files -------------- src/pl/plpgsql/src/pl_exec.c | 35 +++++++++++++++++++++++++++++------ src/pl/plpgsql/src/pl_handler.c | 9 ++++++++- 2 files changed, 37 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Ensure that plpgsql cleans up cleanly during parallel-worker exi @ 2020-03-26 22:07 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2020-03-26 22:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Ensure that plpgsql cleans up cleanly during parallel-worker exit. plpgsql_xact_cb ought to treat events XACT_EVENT_PARALLEL_COMMIT and XACT_EVENT_PARALLEL_ABORT like XACT_EVENT_COMMIT and XACT_EVENT_ABORT respectively, since its goal is to do process-local cleanup. This oversight caused plpgsql's end-of-transaction cleanup to not get done in parallel workers. Since a parallel worker will exit just after the transaction cleanup, the effects of this are limited. I couldn't find any case in the core code with user-visible effects, but perhaps there are some in extensions. In any case it's wrong, so let's fix it before it bites us not after. In passing, add some comments around the handling of expression evaluation resources in DO blocks. There's no live bug there, but it's quite unobvious what's happening; at least I thought so. This isn't related to the other issue, except that I found both things while poking at expression-evaluation performance. Back-patch the plpgsql_xact_cb fix to 9.5 where those event types were introduced, and the DO-block commentary to v11 where DO blocks gained the ability to issue COMMIT/ROLLBACK. Discussion: https://postgr.es/m/10353.1585247879@sss.pgh.pa.us Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/a54a87320782e775794f2f0b05fcd0c1fc5539d0 Modified Files -------------- src/pl/plpgsql/src/pl_exec.c | 35 +++++++++++++++++++++++++++++------ src/pl/plpgsql/src/pl_handler.c | 9 ++++++++- 2 files changed, 37 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Ensure that plpgsql cleans up cleanly during parallel-worker exi @ 2020-03-26 22:07 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2020-03-26 22:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Ensure that plpgsql cleans up cleanly during parallel-worker exit. plpgsql_xact_cb ought to treat events XACT_EVENT_PARALLEL_COMMIT and XACT_EVENT_PARALLEL_ABORT like XACT_EVENT_COMMIT and XACT_EVENT_ABORT respectively, since its goal is to do process-local cleanup. This oversight caused plpgsql's end-of-transaction cleanup to not get done in parallel workers. Since a parallel worker will exit just after the transaction cleanup, the effects of this are limited. I couldn't find any case in the core code with user-visible effects, but perhaps there are some in extensions. In any case it's wrong, so let's fix it before it bites us not after. In passing, add some comments around the handling of expression evaluation resources in DO blocks. There's no live bug there, but it's quite unobvious what's happening; at least I thought so. This isn't related to the other issue, except that I found both things while poking at expression-evaluation performance. Back-patch the plpgsql_xact_cb fix to 9.5 where those event types were introduced, and the DO-block commentary to v11 where DO blocks gained the ability to issue COMMIT/ROLLBACK. Discussion: https://postgr.es/m/10353.1585247879@sss.pgh.pa.us Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/deeda011b316c5c27e4f1c926050a81ffe86c9ef Modified Files -------------- src/pl/plpgsql/src/pl_exec.c | 35 +++++++++++++++++++++++++++++------ src/pl/plpgsql/src/pl_handler.c | 9 ++++++++- 2 files changed, 37 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Ensure that plpgsql cleans up cleanly during parallel-worker exi @ 2020-03-26 22:07 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2020-03-26 22:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Ensure that plpgsql cleans up cleanly during parallel-worker exit. plpgsql_xact_cb ought to treat events XACT_EVENT_PARALLEL_COMMIT and XACT_EVENT_PARALLEL_ABORT like XACT_EVENT_COMMIT and XACT_EVENT_ABORT respectively, since its goal is to do process-local cleanup. This oversight caused plpgsql's end-of-transaction cleanup to not get done in parallel workers. Since a parallel worker will exit just after the transaction cleanup, the effects of this are limited. I couldn't find any case in the core code with user-visible effects, but perhaps there are some in extensions. In any case it's wrong, so let's fix it before it bites us not after. In passing, add some comments around the handling of expression evaluation resources in DO blocks. There's no live bug there, but it's quite unobvious what's happening; at least I thought so. This isn't related to the other issue, except that I found both things while poking at expression-evaluation performance. Back-patch the plpgsql_xact_cb fix to 9.5 where those event types were introduced, and the DO-block commentary to v11 where DO blocks gained the ability to issue COMMIT/ROLLBACK. Discussion: https://postgr.es/m/10353.1585247879@sss.pgh.pa.us Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/42d3649b58f4bd5f06b5e20c24439a9d72bc45b6 Modified Files -------------- src/pl/plpgsql/src/pl_exec.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Ensure that plpgsql cleans up cleanly during parallel-worker exi @ 2020-03-26 22:07 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2020-03-26 22:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Ensure that plpgsql cleans up cleanly during parallel-worker exit. plpgsql_xact_cb ought to treat events XACT_EVENT_PARALLEL_COMMIT and XACT_EVENT_PARALLEL_ABORT like XACT_EVENT_COMMIT and XACT_EVENT_ABORT respectively, since its goal is to do process-local cleanup. This oversight caused plpgsql's end-of-transaction cleanup to not get done in parallel workers. Since a parallel worker will exit just after the transaction cleanup, the effects of this are limited. I couldn't find any case in the core code with user-visible effects, but perhaps there are some in extensions. In any case it's wrong, so let's fix it before it bites us not after. In passing, add some comments around the handling of expression evaluation resources in DO blocks. There's no live bug there, but it's quite unobvious what's happening; at least I thought so. This isn't related to the other issue, except that I found both things while poking at expression-evaluation performance. Back-patch the plpgsql_xact_cb fix to 9.5 where those event types were introduced, and the DO-block commentary to v11 where DO blocks gained the ability to issue COMMIT/ROLLBACK. Discussion: https://postgr.es/m/10353.1585247879@sss.pgh.pa.us Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/dd51b5696aa55a5bf46656bf2d89cbf101d598d3 Modified Files -------------- src/pl/plpgsql/src/pl_exec.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Ensure that plpgsql cleans up cleanly during parallel-worker exi @ 2020-03-26 22:07 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2020-03-26 22:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Ensure that plpgsql cleans up cleanly during parallel-worker exit. plpgsql_xact_cb ought to treat events XACT_EVENT_PARALLEL_COMMIT and XACT_EVENT_PARALLEL_ABORT like XACT_EVENT_COMMIT and XACT_EVENT_ABORT respectively, since its goal is to do process-local cleanup. This oversight caused plpgsql's end-of-transaction cleanup to not get done in parallel workers. Since a parallel worker will exit just after the transaction cleanup, the effects of this are limited. I couldn't find any case in the core code with user-visible effects, but perhaps there are some in extensions. In any case it's wrong, so let's fix it before it bites us not after. In passing, add some comments around the handling of expression evaluation resources in DO blocks. There's no live bug there, but it's quite unobvious what's happening; at least I thought so. This isn't related to the other issue, except that I found both things while poking at expression-evaluation performance. Back-patch the plpgsql_xact_cb fix to 9.5 where those event types were introduced, and the DO-block commentary to v11 where DO blocks gained the ability to issue COMMIT/ROLLBACK. Discussion: https://postgr.es/m/10353.1585247879@sss.pgh.pa.us Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/4bfacc5a441101614744a66322f12f50a0131b65 Modified Files -------------- src/pl/plpgsql/src/pl_exec.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2020-03-26 22:07 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-03-26 22:07 pgsql: Ensure that plpgsql cleans up cleanly during parallel-worker exi Tom Lane <tgl@sss.pgh.pa.us> 2020-03-26 22:07 pgsql: Ensure that plpgsql cleans up cleanly during parallel-worker exi Tom Lane <tgl@sss.pgh.pa.us> 2020-03-26 22:07 pgsql: Ensure that plpgsql cleans up cleanly during parallel-worker exi Tom Lane <tgl@sss.pgh.pa.us> 2020-03-26 22:07 pgsql: Ensure that plpgsql cleans up cleanly during parallel-worker exi Tom Lane <tgl@sss.pgh.pa.us> 2020-03-26 22:07 pgsql: Ensure that plpgsql cleans up cleanly during parallel-worker exi Tom Lane <tgl@sss.pgh.pa.us> 2020-03-26 22:07 pgsql: Ensure that plpgsql cleans up cleanly during parallel-worker exi Tom Lane <tgl@sss.pgh.pa.us>
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