forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit409f9ca
committed
Reset properly snapshot export state during transaction abort
During a replication slot creation, an ERROR generated in the sametransaction as the one creating a to-be-exported snapshot would haveleft the backend in an inconsistent state, as the associated staticexport snapshot state was not being reset on transaction abort, but onlyon the follow-up command received by the WAL sender that created thissnapshot on replication slot creation. This would trigger inconsistencyfailures if this session tried to export again a snapshot, like duringthe creation of a replication slot.Note that a snapshot export cannot happen in a transaction block, sothere is no need to worry resetting this state for subtransactionaborts. Also, this inconsistent state would very unlikely show up tousers. For example, one case where this could happen is anout-of-memory error when building the initial snapshot to-be-exported.Dilip found this problem while poking at a different patch, that causedan error in this code path for reasons unrelated to HEAD.Author: Dilip KumarReviewed-by: Michael Paquier, Zhihong YuDiscussion:https://postgr.es/m/CAFiTN-s0zA1Kj0ozGHwkYkHwa5U0zUE94RSc_g81WrpcETB5=w@mail.gmail.comBackpatch-through: 9.61 parent384f1ab commit409f9ca
File tree
3 files changed
+28
-2
lines changed- src
- backend
- access/transam
- replication/logical
- include/replication
3 files changed
+28
-2
lines changedLines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
| 49 | + | |
49 | 50 |
| |
50 | 51 |
| |
51 | 52 |
| |
| |||
2698 | 2699 |
| |
2699 | 2700 |
| |
2700 | 2701 |
| |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
2701 | 2705 |
| |
2702 | 2706 |
| |
2703 | 2707 |
| |
| |||
5010 | 5014 |
| |
5011 | 5015 |
| |
5012 | 5016 |
| |
| 5017 | + | |
| 5018 | + | |
| 5019 | + | |
| 5020 | + | |
| 5021 | + | |
5013 | 5022 |
| |
5014 | 5023 |
| |
5015 | 5024 |
| |
|
Lines changed: 18 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
682 | 682 |
| |
683 | 683 |
| |
684 | 684 |
| |
| 685 | + | |
| 686 | + | |
685 | 687 |
| |
686 | 688 |
| |
687 | 689 |
| |
688 | 690 |
| |
689 | 691 |
| |
690 | 692 |
| |
691 | 693 |
| |
692 |
| - | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
693 | 701 |
| |
694 | 702 |
| |
695 |
| - | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
696 | 712 |
| |
697 | 713 |
| |
698 | 714 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
70 | 70 |
| |
71 | 71 |
| |
72 | 72 |
| |
| 73 | + | |
73 | 74 |
| |
74 | 75 |
| |
75 | 76 |
| |
|
0 commit comments
Comments
(0)