forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf5f30c2
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 parentbd15b7d commitf5f30c2
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 | |
---|---|---|---|
| |||
1410 | 1410 |
| |
1411 | 1411 |
| |
1412 | 1412 |
| |
1413 |
| - | |
1414 |
| - | |
1415 |
| - | |
1416 |
| - | |
1417 | 1413 |
| |
1418 | 1414 |
| |
1419 | 1415 |
| |
| |||
1455 | 1451 |
| |
1456 | 1452 |
| |
1457 | 1453 |
| |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
1458 | 1462 |
| |
1459 | 1463 |
| |
1460 | 1464 |
| |
|
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 | |
---|---|---|---|
| |||
1329 | 1329 |
| |
1330 | 1330 |
| |
1331 | 1331 |
| |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + |
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
511 | 511 |
| |
512 | 512 |
| |
513 | 513 |
| |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + |
0 commit comments
Comments
(0)