forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit849326e
committed
Allow parallel workers to cope with a newly-created session user ID.
Parallel workers failed after a sequence likeBEGIN;CREATE USER foo;SET SESSION AUTHORIZATION foo;because check_session_authorization could not see the uncommittedpg_authid row for "foo". This is because we ran RestoreGUCState()in a separate transaction using an ordinary just-created snapshot.The same disease afflicts any other GUC that requires catalog lookupsand isn't forgiving about the lookups failing.To fix, postpone RestoreGUCState() into the worker's main transactionafter we've set up a snapshot duplicating the leader's. This affectscheck_transaction_isolation and check_transaction_deferrable, whichthink they should only run during transaction start. Make themact like check_transaction_read_only, which already knows it shouldsilently accept the value when InitializingParallelWorker.Per bug #18545 from Andrey Rachitskiy. Back-patch to allsupported branches, because this has been wrong for awhile.Discussion:https://postgr.es/m/18545-feba138862f19aaa@postgresql.org1 parenta459e58 commit849326e
File tree
4 files changed
+43
-6
lines changed- src
- backend
- access/transam
- commands
- test/regress
- expected
- sql
4 files changed
+43
-6
lines changedLines changed: 8 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1414 | 1414 |
| |
1415 | 1415 |
| |
1416 | 1416 |
| |
1417 |
| - | |
1418 |
| - | |
1419 |
| - | |
1420 |
| - | |
1421 | 1417 |
| |
1422 | 1418 |
| |
1423 | 1419 |
| |
| |||
1459 | 1455 |
| |
1460 | 1456 |
| |
1461 | 1457 |
| |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
1462 | 1466 |
| |
1463 | 1467 |
| |
1464 | 1468 |
| |
|
Lines changed: 8 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
577 | 577 |
| |
578 | 578 |
| |
579 | 579 |
| |
580 |
| - | |
| 580 | + | |
| 581 | + | |
581 | 582 |
| |
582 | 583 |
| |
583 | 584 |
| |
584 | 585 |
| |
585 | 586 |
| |
586 | 587 |
| |
587 |
| - | |
| 588 | + | |
| 589 | + | |
588 | 590 |
| |
589 | 591 |
| |
590 | 592 |
| |
| |||
619 | 621 |
| |
620 | 622 |
| |
621 | 623 |
| |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
622 | 628 |
| |
623 | 629 |
| |
624 | 630 |
| |
|
Lines changed: 18 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1219 | 1219 |
| |
1220 | 1220 |
| |
1221 | 1221 |
| |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + |
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
462 | 462 |
| |
463 | 463 |
| |
464 | 464 |
| |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + |
0 commit comments
Comments
(0)