Commit de88ec6
committed
Treat 2PC commit/abort the same as regular xacts in recovery.
There were several oversights in recovery code where COMMIT/ABORT PREPARED
records were ignored:
* pg_last_xact_replay_timestamp() (wasn't updated for 2PC commits)
* recovery_min_apply_delay (2PC commits were applied immediately)
* recovery_target_xid (recovery would not stop if the XID used 2PC)
The first of those was reported by Sergiy Zuban in bug #11032, analyzed by
Tom Lane and Andres Freund. The bug was always there, but was masked before
commit d19bd29, because COMMIT PREPARED
always created an extra regular transaction that was WAL-logged.
Backpatch to all supported versions (older versions didn't have all the
features and therefore didn't have all of the above bugs).1 parent 8d49bf1 commit de88ec6
2 files changed
+27
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5648 | 5648 | | |
5649 | 5649 | | |
5650 | 5650 | | |
| 5651 | + | |
5651 | 5652 | | |
5652 | 5653 | | |
5653 | 5654 | | |
| |||
5660 | 5661 | | |
5661 | 5662 | | |
5662 | 5663 | | |
| 5664 | + | |
| 5665 | + | |
| 5666 | + | |
| 5667 | + | |
| 5668 | + | |
| 5669 | + | |
| 5670 | + | |
| 5671 | + | |
| 5672 | + | |
5663 | 5673 | | |
5664 | 5674 | | |
5665 | 5675 | | |
5666 | 5676 | | |
5667 | 5677 | | |
5668 | 5678 | | |
5669 | 5679 | | |
| 5680 | + | |
| 5681 | + | |
| 5682 | + | |
| 5683 | + | |
| 5684 | + | |
| 5685 | + | |
| 5686 | + | |
| 5687 | + | |
| 5688 | + | |
5670 | 5689 | | |
5671 | 5690 | | |
5672 | 5691 | | |
5673 | 5692 | | |
5674 | 5693 | | |
5675 | 5694 | | |
5676 | 5695 | | |
| 5696 | + | |
5677 | 5697 | | |
5678 | 5698 | | |
5679 | 5699 | | |
| |||
5702 | 5722 | | |
5703 | 5723 | | |
5704 | 5724 | | |
5705 | | - | |
| 5725 | + | |
5706 | 5726 | | |
5707 | 5727 | | |
5708 | 5728 | | |
| |||
5737 | 5757 | | |
5738 | 5758 | | |
5739 | 5759 | | |
5740 | | - | |
| 5760 | + | |
5741 | 5761 | | |
5742 | 5762 | | |
5743 | 5763 | | |
5744 | | - | |
| 5764 | + | |
| 5765 | + | |
5745 | 5766 | | |
5746 | 5767 | | |
5747 | 5768 | | |
| |||
5754 | 5775 | | |
5755 | 5776 | | |
5756 | 5777 | | |
5757 | | - | |
| 5778 | + | |
| 5779 | + | |
5758 | 5780 | | |
5759 | 5781 | | |
5760 | 5782 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
169 | | - | |
| 168 | + | |
170 | 169 | | |
171 | 170 | | |
172 | 171 | | |
| |||
0 commit comments