forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6e086fa
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.This un-reverts commitf5f30c2. The original plan was to back-patchthat, but the fact that0ae5b76 proved to be a pre-requisite showsthat the subtle API change for GUC hooks might actually break some ofthem. The problem we're trying to fix seems not worth taking such arisk for in stable branches.Per bug #18545 from Andrey Rachitskiy.Discussion:https://postgr.es/m/18545-feba138862f19aaa@postgresql.org1 parent0ae5b76 commit6e086fa
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 | |
---|---|---|---|
| |||
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)