forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5887dd4
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 parent3256722 commit5887dd4
File tree
4 files changed
+43
-6
lines changed- src
- backend
- access/transam
- commands
- test/regress
- expected
- sql
4 files changed
+43
-6
lines changed| 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 | | |
| |||
| 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 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1294 | 1294 | | |
1295 | 1295 | | |
1296 | 1296 | | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
496 | 496 | | |
497 | 497 | | |
498 | 498 | | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
0 commit comments
Comments
(0)