forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8bdb133

Amit Kapila
Avoid repeated decoding of prepared transactions after a restart.
In commita271a1b, we allowed decoding at prepare time and the preparewas decoded again if there is a restart after decoding it. It was donethat way because we can't distinguish between the cases where we have notdecoded the prepare because it was prior to consistent snapshot or we havedecoded it earlier but restarted. To distinguish between these two cases,we have introduced an initial_consistent_point at the slot level which isan LSN at which we found a consistent point at the time of slot creation.This is also the point where we have exported a snapshot for the initialcopy. So, prepare transaction prior to this point are sent along withcommit prepared.This commit bumps SNAPBUILD_VERSION because of change in SnapBuild. Itwill break existing slots which is fine in a major release.Author: Ajin Cherian, based on idea by Andres FreundReviewed-by: Amit Kapila and Vignesh CDiscussion:https://postgr.es/m/d0f60d60-133d-bf8d-bd70-47784d8fabf3@enterprisedb.com1 parent6230912 commit8bdb133
File tree
10 files changed
+61
-67
lines changed- contrib/test_decoding/expected
- doc/src/sgml
- src
- backend/replication/logical
- include/replication
10 files changed
+61
-67
lines changedLines changed: 12 additions & 26 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
36 |
| - | |
37 |
| - | |
38 |
| - | |
39 |
| - | |
40 |
| - | |
41 |
| - | |
| 36 | + | |
| 37 | + | |
42 | 38 |
| |
43 |
| - | |
| 39 | + | |
44 | 40 |
| |
45 | 41 |
| |
46 | 42 |
| |
| |||
103 | 99 |
| |
104 | 100 |
| |
105 | 101 |
| |
106 |
| - | |
107 |
| - | |
108 |
| - | |
109 |
| - | |
110 |
| - | |
| 102 | + | |
| 103 | + | |
111 | 104 |
| |
112 |
| - | |
| 105 | + | |
113 | 106 |
| |
114 | 107 |
| |
115 | 108 |
| |
| |||
158 | 151 |
| |
159 | 152 |
| |
160 | 153 |
| |
161 |
| - | |
162 |
| - | |
163 |
| - | |
164 |
| - | |
165 |
| - | |
166 |
| - | |
| 154 | + | |
| 155 | + | |
167 | 156 |
| |
168 |
| - | |
| 157 | + | |
169 | 158 |
| |
170 | 159 |
| |
171 | 160 |
| |
| |||
188 | 177 |
| |
189 | 178 |
| |
190 | 179 |
| |
191 |
| - | |
192 |
| - | |
193 |
| - | |
194 |
| - | |
195 |
| - | |
| 180 | + | |
| 181 | + | |
196 | 182 |
| |
197 |
| - | |
| 183 | + | |
198 | 184 |
| |
199 | 185 |
| |
200 | 186 |
| |
|
Lines changed: 3 additions & 25 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
60 | 60 |
| |
61 | 61 |
| |
62 | 62 |
| |
63 |
| - | |
64 |
| - | |
65 |
| - | |
66 |
| - | |
67 |
| - | |
68 |
| - | |
69 |
| - | |
70 |
| - | |
71 |
| - | |
72 |
| - | |
73 |
| - | |
74 |
| - | |
75 |
| - | |
76 |
| - | |
77 |
| - | |
78 |
| - | |
79 |
| - | |
80 |
| - | |
81 |
| - | |
82 |
| - | |
83 |
| - | |
84 |
| - | |
85 |
| - | |
86 |
| - | |
| 63 | + | |
| 64 | + | |
87 | 65 |
| |
88 |
| - | |
| 66 | + | |
89 | 67 |
| |
90 | 68 |
| |
91 | 69 |
| |
|
Lines changed: 2 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
191 | 191 |
| |
192 | 192 |
| |
193 | 193 |
| |
194 |
| - | |
195 |
| - | |
196 |
| - | |
197 | 194 |
| |
198 | 195 |
| |
199 | 196 |
| |
| |||
822 | 819 |
| |
823 | 820 |
| |
824 | 821 |
| |
825 |
| - | |
826 |
| - | |
827 |
| - | |
828 |
| - | |
| 822 | + | |
| 823 | + | |
829 | 824 |
| |
830 | 825 |
| |
831 | 826 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
730 | 730 |
| |
731 | 731 |
| |
732 | 732 |
| |
| 733 | + | |
733 | 734 |
| |
734 | 735 |
| |
735 | 736 |
| |
| |||
868 | 869 |
| |
869 | 870 |
| |
870 | 871 |
| |
| 872 | + | |
871 | 873 |
| |
872 | 874 |
| |
873 | 875 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
207 | 207 |
| |
208 | 208 |
| |
209 | 209 |
| |
210 |
| - | |
| 210 | + | |
211 | 211 |
| |
212 | 212 |
| |
213 | 213 |
| |
| |||
590 | 590 |
| |
591 | 591 |
| |
592 | 592 |
| |
| 593 | + | |
593 | 594 |
| |
594 | 595 |
| |
595 | 596 |
| |
|
Lines changed: 5 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2672 | 2672 |
| |
2673 | 2673 |
| |
2674 | 2674 |
| |
| 2675 | + | |
2675 | 2676 |
| |
2676 | 2677 |
| |
2677 | 2678 |
| |
| |||
2698 | 2699 |
| |
2699 | 2700 |
| |
2700 | 2701 |
| |
2701 |
| - | |
2702 |
| - | |
2703 |
| - | |
2704 |
| - | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
2705 | 2705 |
| |
2706 |
| - | |
| 2706 | + | |
2707 | 2707 |
| |
2708 | 2708 |
| |
2709 | 2709 |
| |
|
Lines changed: 24 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
164 | 164 |
| |
165 | 165 |
| |
166 | 166 |
| |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
167 | 178 |
| |
168 | 179 |
| |
169 | 180 |
| |
| |||
269 | 280 |
| |
270 | 281 |
| |
271 | 282 |
| |
272 |
| - | |
| 283 | + | |
| 284 | + | |
273 | 285 |
| |
274 | 286 |
| |
275 | 287 |
| |
| |||
297 | 309 |
| |
298 | 310 |
| |
299 | 311 |
| |
| 312 | + | |
300 | 313 |
| |
301 | 314 |
| |
302 | 315 |
| |
| |||
356 | 369 |
| |
357 | 370 |
| |
358 | 371 |
| |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
359 | 381 |
| |
360 | 382 |
| |
361 | 383 |
| |
| |||
1422 | 1444 |
| |
1423 | 1445 |
| |
1424 | 1446 |
| |
1425 |
| - | |
| 1447 | + | |
1426 | 1448 |
| |
1427 | 1449 |
| |
1428 | 1450 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
643 | 643 |
| |
644 | 644 |
| |
645 | 645 |
| |
| 646 | + | |
646 | 647 |
| |
647 | 648 |
| |
648 | 649 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
91 | 91 |
| |
92 | 92 |
| |
93 | 93 |
| |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
94 | 101 |
| |
95 | 102 |
| |
96 | 103 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
61 | 61 |
| |
62 | 62 |
| |
63 | 63 |
| |
64 |
| - | |
| 64 | + | |
| 65 | + | |
65 | 66 |
| |
66 | 67 |
| |
67 | 68 |
| |
| |||
75 | 76 |
| |
76 | 77 |
| |
77 | 78 |
| |
| 79 | + | |
78 | 80 |
| |
79 | 81 |
| |
80 | 82 |
| |
|
0 commit comments
Comments
(0)