forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit86e5bad
committed
Ensure that plpgsql cleans up cleanly during parallel-worker exit.
plpgsql_xact_cb ought to treat events XACT_EVENT_PARALLEL_COMMIT andXACT_EVENT_PARALLEL_ABORT like XACT_EVENT_COMMIT and XACT_EVENT_ABORTrespectively, since its goal is to do process-local cleanup. Thisoversight caused plpgsql's end-of-transaction cleanup to not get donein parallel workers. Since a parallel worker will exit just after thetransaction cleanup, the effects of this are limited. I couldn't findany case in the core code with user-visible effects, but perhaps thereare some in extensions. In any case it's wrong, so let's fix it beforeit bites us not after.In passing, add some comments around the handling of expressionevaluation resources in DO blocks. There's no live bug there, but it'squite unobvious what's happening; at least I thought so. This isn'trelated to the other issue, except that I found both things while pokingat expression-evaluation performance.Back-patch the plpgsql_xact_cb fix to 9.5 where those event typeswere introduced, and the DO-block commentary to v11 where DO blocksgained the ability to issue COMMIT/ROLLBACK.Discussion:https://postgr.es/m/10353.1585247879@sss.pgh.pa.us1 parenteff5b24 commit86e5bad
2 files changed
+37
-7
lines changedLines changed: 29 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
84 | 84 |
| |
85 | 85 |
| |
86 | 86 |
| |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
87 | 94 |
| |
88 | 95 |
| |
89 | 96 |
| |
| |||
2315 | 2322 |
| |
2316 | 2323 |
| |
2317 | 2324 |
| |
2318 |
| - | |
2319 |
| - | |
| 2325 | + | |
| 2326 | + | |
2320 | 2327 |
| |
2321 | 2328 |
| |
2322 | 2329 |
| |
| |||
4824 | 4831 |
| |
4825 | 4832 |
| |
4826 | 4833 |
| |
| 4834 | + | |
| 4835 | + | |
| 4836 | + | |
| 4837 | + | |
4827 | 4838 |
| |
4828 | 4839 |
| |
4829 | 4840 |
| |
| |||
4846 | 4857 |
| |
4847 | 4858 |
| |
4848 | 4859 |
| |
| 4860 | + | |
| 4861 | + | |
| 4862 | + | |
| 4863 | + | |
4849 | 4864 |
| |
4850 | 4865 |
| |
4851 | 4866 |
| |
| |||
8208 | 8223 |
| |
8209 | 8224 |
| |
8210 | 8225 |
| |
8211 |
| - | |
8212 |
| - | |
| 8226 | + | |
| 8227 | + | |
| 8228 | + | |
| 8229 | + | |
| 8230 | + | |
| 8231 | + | |
| 8232 | + | |
8213 | 8233 |
| |
8214 | 8234 |
| |
8215 | 8235 |
| |
| |||
8281 | 8301 |
| |
8282 | 8302 |
| |
8283 | 8303 |
| |
8284 |
| - | |
| 8304 | + | |
| 8305 | + | |
| 8306 | + | |
8285 | 8307 |
| |
8286 | 8308 |
| |
8287 | 8309 |
| |
8288 | 8310 |
| |
8289 | 8311 |
| |
8290 | 8312 |
| |
8291 | 8313 |
| |
8292 |
| - | |
| 8314 | + | |
| 8315 | + | |
8293 | 8316 |
| |
8294 | 8317 |
| |
8295 | 8318 |
| |
|
Lines changed: 8 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
323 | 323 |
| |
324 | 324 |
| |
325 | 325 |
| |
326 |
| - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
327 | 334 |
| |
328 | 335 |
| |
329 | 336 |
| |
|
0 commit comments
Comments
(0)