forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7abaa6b
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 parent406473b commit7abaa6b
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 | |
---|---|---|---|
| |||
533 | 533 |
| |
534 | 534 |
| |
535 | 535 |
| |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
536 | 541 |
| |
537 | 542 |
| |
538 | 543 |
| |
539 | 544 |
| |
540 |
| - | |
| 545 | + | |
541 | 546 |
| |
542 | 547 |
| |
543 | 548 |
| |
| |||
556 | 561 |
| |
557 | 562 |
| |
558 | 563 |
| |
| 564 | + | |
559 | 565 |
| |
560 | 566 |
| |
561 | 567 |
| |
| |||
569 | 575 |
| |
570 | 576 |
| |
571 | 577 |
| |
| 578 | + | |
| 579 | + | |
572 | 580 |
| |
573 | 581 |
| |
574 | 582 |
| |
| |||
598 | 606 |
| |
599 | 607 |
| |
600 | 608 |
| |
601 |
| - | |
| 609 | + | |
602 | 610 |
| |
603 | 611 |
| |
604 | 612 |
| |
| |||
616 | 624 |
| |
617 | 625 |
| |
618 | 626 |
| |
| 627 | + | |
619 | 628 |
| |
620 | 629 |
| |
621 | 630 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1571 | 1571 |
| |
1572 | 1572 |
| |
1573 | 1573 |
| |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
1574 | 1587 |
| |
1575 | 1588 |
| |
1576 | 1589 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
584 | 584 |
| |
585 | 585 |
| |
586 | 586 |
| |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
587 | 596 |
| |
588 | 597 |
| |
589 | 598 |
| |
|
0 commit comments
Comments
(0)