forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit180ce0a
committed
Fix issues with checks for unsupported transaction states in Hot Standby.
The GUC check hooks for transaction_read_only and transaction_isolationtried to check RecoveryInProgress(), so as to disallow setting read/writemode or serializable isolation level (respectively) in hot standbysessions. However, GUC check hooks can be called in many situations wherewe're not connected to shared memory at all, resulting in a crash inRecoveryInProgress(). Among other cases, this results in EXEC_BACKENDbuilds crashing during child process start if default_transaction_isolationis serializable, as reported by Heikki Linnakangas. Protect those callsby silently allowing any setting when not inside a transaction; which isokay anyway since these GUCs are always reset at start of transaction.Also, add a check to GetSerializableTransactionSnapshot() to complainif we are in hot standby. We need that check despite the one incheck_XactIsoLevel() because default_transaction_isolation could beserializable. We don't want to complain any sooner than this in suchcases, since that would prevent running transactions at all in such astate; but a transaction can be run, if SET TRANSACTION ISOLATION is donebefore setting a snapshot. Per report some months ago from Robert Haas.Back-patch to 9.1, since these problems were introduced by the SSI patch.Kevin Grittner and Tom Lane, with ideas from Heikki Linnakangas1 parentff122d3 commit180ce0a
File tree
3 files changed
+33
-2
lines changed- src/backend
- commands
- storage/lmgr
- utils/init
3 files changed
+33
-2
lines changedLines changed: 11 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
569 | 569 |
| |
570 | 570 |
| |
571 | 571 |
| |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
572 | 577 |
| |
573 | 578 |
| |
574 | 579 |
| |
575 | 580 |
| |
576 |
| - | |
| 581 | + | |
577 | 582 |
| |
578 | 583 |
| |
579 | 584 |
| |
| |||
592 | 597 |
| |
593 | 598 |
| |
594 | 599 |
| |
| 600 | + | |
595 | 601 |
| |
596 | 602 |
| |
597 | 603 |
| |
| |||
605 | 611 |
| |
606 | 612 |
| |
607 | 613 |
| |
| 614 | + | |
| 615 | + | |
608 | 616 |
| |
609 | 617 |
| |
610 | 618 |
| |
| |||
634 | 642 |
| |
635 | 643 |
| |
636 | 644 |
| |
637 |
| - | |
| 645 | + | |
638 | 646 |
| |
639 | 647 |
| |
640 | 648 |
| |
| |||
652 | 660 |
| |
653 | 661 |
| |
654 | 662 |
| |
| 663 | + | |
655 | 664 |
| |
656 | 665 |
| |
657 | 666 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1558 | 1558 |
| |
1559 | 1559 |
| |
1560 | 1560 |
| |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
1561 | 1574 |
| |
1562 | 1575 |
| |
1563 | 1576 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
574 | 574 |
| |
575 | 575 |
| |
576 | 576 |
| |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
577 | 586 |
| |
578 | 587 |
| |
579 | 588 |
| |
|
0 commit comments
Comments
(0)