forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitcbfbda7
committed
Fix MVCC bug with prepared xact with subxacts on standby
We did not recover the subtransaction IDs of prepared transactionswhen starting a hot standby from a shutdown checkpoint. As a result,such subtransactions were considered as aborted, rather thanin-progress. That would lead to hint bits being set incorrectly, andthe subtransactions suddenly becoming visible to old snapshots whenthe prepared transaction was committed.To fix, update pg_subtrans with prepared transactions's subxids whenstarting hot standby from a shutdown checkpoint. The snapshots takenfrom that state need to be marked as "suboverflowed", so that we alsocheck the pg_subtrans.Backport to all supported versions.Discussion:https://www.postgresql.org/message-id/6b852e98-2d49-4ca1-9e95-db419a2696e0@iki.fi1 parentecbf6ac commitcbfbda7
File tree
7 files changed
+85
-17
lines changed- src
- backend
- access/transam
- storage/ipc
- include/storage
- test/recovery/t
- tools/pgindent
7 files changed
+85
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2035 | 2035 | | |
2036 | 2036 | | |
2037 | 2037 | | |
2038 | | - | |
2039 | | - | |
2040 | | - | |
| 2038 | + | |
| 2039 | + | |
2041 | 2040 | | |
2042 | 2041 | | |
2043 | 2042 | | |
| |||
2057 | 2056 | | |
2058 | 2057 | | |
2059 | 2058 | | |
2060 | | - | |
| 2059 | + | |
2061 | 2060 | | |
2062 | 2061 | | |
2063 | 2062 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5777 | 5777 | | |
5778 | 5778 | | |
5779 | 5779 | | |
| 5780 | + | |
| 5781 | + | |
| 5782 | + | |
5780 | 5783 | | |
5781 | 5784 | | |
5782 | 5785 | | |
| |||
5785 | 5788 | | |
5786 | 5789 | | |
5787 | 5790 | | |
5788 | | - | |
| 5791 | + | |
5789 | 5792 | | |
5790 | 5793 | | |
5791 | 5794 | | |
| |||
5795 | 5798 | | |
5796 | 5799 | | |
5797 | 5800 | | |
5798 | | - | |
5799 | | - | |
5800 | 5801 | | |
5801 | 5802 | | |
5802 | 5803 | | |
| |||
8244 | 8245 | | |
8245 | 8246 | | |
8246 | 8247 | | |
| 8248 | + | |
| 8249 | + | |
| 8250 | + | |
8247 | 8251 | | |
8248 | 8252 | | |
8249 | 8253 | | |
| |||
8252 | 8256 | | |
8253 | 8257 | | |
8254 | 8258 | | |
8255 | | - | |
| 8259 | + | |
8256 | 8260 | | |
8257 | 8261 | | |
8258 | 8262 | | |
| |||
8262 | 8266 | | |
8263 | 8267 | | |
8264 | 8268 | | |
8265 | | - | |
8266 | | - | |
8267 | 8269 | | |
8268 | 8270 | | |
8269 | 8271 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1106 | 1106 | | |
1107 | 1107 | | |
1108 | 1108 | | |
1109 | | - | |
| 1109 | + | |
1110 | 1110 | | |
1111 | 1111 | | |
1112 | 1112 | | |
| |||
1258 | 1258 | | |
1259 | 1259 | | |
1260 | 1260 | | |
1261 | | - | |
| 1261 | + | |
1262 | 1262 | | |
1263 | 1263 | | |
1264 | 1264 | | |
| |||
1270 | 1270 | | |
1271 | 1271 | | |
1272 | 1272 | | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
1273 | 1285 | | |
1274 | 1286 | | |
1275 | 1287 | | |
| |||
2833 | 2845 | | |
2834 | 2846 | | |
2835 | 2847 | | |
2836 | | - | |
| 2848 | + | |
2837 | 2849 | | |
2838 | 2850 | | |
2839 | 2851 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1184 | 1184 | | |
1185 | 1185 | | |
1186 | 1186 | | |
1187 | | - | |
| 1187 | + | |
1188 | 1188 | | |
1189 | 1189 | | |
1190 | 1190 | | |
| |||
1349 | 1349 | | |
1350 | 1350 | | |
1351 | 1351 | | |
1352 | | - | |
| 1352 | + | |
1353 | 1353 | | |
1354 | 1354 | | |
1355 | 1355 | | |
| |||
1366 | 1366 | | |
1367 | 1367 | | |
1368 | 1368 | | |
1369 | | - | |
| 1369 | + | |
1370 | 1370 | | |
1371 | 1371 | | |
1372 | 1372 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
78 | 86 | | |
79 | 87 | | |
80 | 88 | | |
81 | 89 | | |
82 | | - | |
| 90 | + | |
83 | 91 | | |
84 | 92 | | |
85 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
315 | 361 | | |
316 | 362 | | |
317 | 363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3931 | 3931 | | |
3932 | 3932 | | |
3933 | 3933 | | |
| 3934 | + | |
3934 | 3935 | | |
3935 | 3936 | | |
3936 | 3937 | | |
| |||
0 commit comments
Comments
(0)