forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0075d78
committed
Allow "internal" subtransactions in parallel mode.
Allow use of BeginInternalSubTransaction() in parallel mode, so longas the subtransaction doesn't attempt to acquire an XID or incrementthe command counter. Given those restrictions, the other parallelprocesses don't need to know about the subtransaction at all, sothis should be safe. The benefit is that it allows subtransactionsintended for error recovery, such as pl/pgsql exception blocks,to be used in PARALLEL SAFE functions.Another reason for doing this is that the API ofBeginInternalSubTransaction() doesn't allow reporting failure.pl/python for one, and perhaps other PLs, copes very poorly with anerror longjmp out of BeginInternalSubTransaction(). The headlinefeature of this patch removes the only easily-triggerable failurecase within that function. There remain some resource-exhaustionand similar cases, which we now deal with by promoting them to FATALerrors, so that callers need not try to clean up. (It is likelythat such errors would leave us with corrupted transaction stateinside xact.c, making recovery difficult if not impossible anyway.)Although this work started because of a report of a pl/python crash,we're not going to do anything about that in the back branches.Back-patching this particular fix is obviously not very wise.While we could contemplate some narrower band-aid, pl/python isalready an untrusted language, so it seems okay to classify thisas a "so don't do that" case.Patch by me, per report from Hao Zhang. Thanks to Robert Haas forreview.Discussion:https://postgr.es/m/CALY6Dr-2yLVeVPhNMhuBnRgOZo1UjoTETgtKBx1B2gUi8yy+3g@mail.gmail.com1 parente2395cd commit0075d78
File tree
7 files changed
+181
-88
lines changed- doc/src/sgml
- ref
- src
- backend/access/transam
- test/regress
- expected
- sql
7 files changed
+181
-88
lines changedLines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
545 | 545 |
| |
546 | 546 |
| |
547 | 547 |
| |
548 |
| - | |
549 |
| - | |
550 |
| - | |
551 |
| - | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
552 | 552 |
| |
553 | 553 |
| |
554 | 554 |
| |
|
Lines changed: 11 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
428 | 428 |
| |
429 | 429 |
| |
430 | 430 |
| |
431 |
| - | |
432 |
| - | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
433 | 434 |
| |
434 | 435 |
| |
435 |
| - | |
436 |
| - | |
| 436 | + | |
| 437 | + | |
437 | 438 |
| |
438 |
| - | |
| 439 | + | |
439 | 440 |
| |
440 | 441 |
| |
441 | 442 |
| |
442 | 443 |
| |
443 |
| - | |
444 |
| - | |
445 |
| - | |
446 |
| - | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
447 | 449 |
| |
448 | 450 |
| |
449 | 451 |
| |
|
Lines changed: 7 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
137 | 137 |
| |
138 | 138 |
| |
139 | 139 |
| |
140 |
| - | |
| 140 | + | |
141 | 141 |
| |
142 | 142 |
| |
143 | 143 |
| |
| |||
153 | 153 |
| |
154 | 154 |
| |
155 | 155 |
| |
156 |
| - | |
| 156 | + | |
157 | 157 |
| |
158 | 158 |
| |
159 | 159 |
| |
160 | 160 |
| |
161 | 161 |
| |
162 | 162 |
| |
163 |
| - | |
164 |
| - | |
165 |
| - | |
166 |
| - | |
167 |
| - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
168 | 168 |
| |
169 | 169 |
| |
170 | 170 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1226 | 1226 |
| |
1227 | 1227 |
| |
1228 | 1228 |
| |
1229 |
| - | |
1230 |
| - | |
1231 |
| - | |
1232 |
| - | |
| 1229 | + | |
| 1230 | + | |
1233 | 1231 |
| |
1234 | 1232 |
| |
1235 | 1233 |
| |
| |||
1249 | 1247 |
| |
1250 | 1248 |
| |
1251 | 1249 |
| |
| 1250 | + | |
| 1251 | + | |
1252 | 1252 |
| |
1253 | 1253 |
| |
1254 | 1254 |
| |
|
0 commit comments
Comments
(0)