forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb5b418b
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 parente00a9a4 commitb5b418b
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 changedLines changed: 3 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2011 | 2011 |
| |
2012 | 2012 |
| |
2013 | 2013 |
| |
2014 |
| - | |
2015 |
| - | |
2016 |
| - | |
| 2014 | + | |
| 2015 | + | |
2017 | 2016 |
| |
2018 | 2017 |
| |
2019 | 2018 |
| |
| |||
2033 | 2032 |
| |
2034 | 2033 |
| |
2035 | 2034 |
| |
2036 |
| - | |
| 2035 | + | |
2037 | 2036 |
| |
2038 | 2037 |
| |
2039 | 2038 |
| |
|
Lines changed: 8 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5420 | 5420 |
| |
5421 | 5421 |
| |
5422 | 5422 |
| |
| 5423 | + | |
| 5424 | + | |
| 5425 | + | |
5423 | 5426 |
| |
5424 | 5427 |
| |
5425 | 5428 |
| |
| |||
5428 | 5431 |
| |
5429 | 5432 |
| |
5430 | 5433 |
| |
5431 |
| - | |
| 5434 | + | |
5432 | 5435 |
| |
5433 | 5436 |
| |
5434 | 5437 |
| |
| |||
5438 | 5441 |
| |
5439 | 5442 |
| |
5440 | 5443 |
| |
5441 |
| - | |
5442 |
| - | |
5443 | 5444 |
| |
5444 | 5445 |
| |
5445 | 5446 |
| |
| |||
7808 | 7809 |
| |
7809 | 7810 |
| |
7810 | 7811 |
| |
| 7812 | + | |
| 7813 | + | |
| 7814 | + | |
7811 | 7815 |
| |
7812 | 7816 |
| |
7813 | 7817 |
| |
| |||
7816 | 7820 |
| |
7817 | 7821 |
| |
7818 | 7822 |
| |
7819 |
| - | |
| 7823 | + | |
7820 | 7824 |
| |
7821 | 7825 |
| |
7822 | 7826 |
| |
| |||
7826 | 7830 |
| |
7827 | 7831 |
| |
7828 | 7832 |
| |
7829 |
| - | |
7830 |
| - | |
7831 | 7833 |
| |
7832 | 7834 |
| |
7833 | 7835 |
| |
|
Lines changed: 15 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1097 | 1097 |
| |
1098 | 1098 |
| |
1099 | 1099 |
| |
1100 |
| - | |
| 1100 | + | |
1101 | 1101 |
| |
1102 | 1102 |
| |
1103 | 1103 |
| |
| |||
1249 | 1249 |
| |
1250 | 1250 |
| |
1251 | 1251 |
| |
1252 |
| - | |
| 1252 | + | |
1253 | 1253 |
| |
1254 | 1254 |
| |
1255 | 1255 |
| |
| |||
1261 | 1261 |
| |
1262 | 1262 |
| |
1263 | 1263 |
| |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
1264 | 1276 |
| |
1265 | 1277 |
| |
1266 | 1278 |
| |
| |||
2842 | 2854 |
| |
2843 | 2855 |
| |
2844 | 2856 |
| |
2845 |
| - | |
| 2857 | + | |
2846 | 2858 |
| |
2847 | 2859 |
| |
2848 | 2860 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1186 | 1186 |
| |
1187 | 1187 |
| |
1188 | 1188 |
| |
1189 |
| - | |
| 1189 | + | |
1190 | 1190 |
| |
1191 | 1191 |
| |
1192 | 1192 |
| |
| |||
1351 | 1351 |
| |
1352 | 1352 |
| |
1353 | 1353 |
| |
1354 |
| - | |
| 1354 | + | |
1355 | 1355 |
| |
1356 | 1356 |
| |
1357 | 1357 |
| |
| |||
1368 | 1368 |
| |
1369 | 1369 |
| |
1370 | 1370 |
| |
1371 |
| - | |
| 1371 | + | |
1372 | 1372 |
| |
1373 | 1373 |
| |
1374 | 1374 |
| |
|
Lines changed: 9 additions & 1 deletion
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 |
| |
|
Lines changed: 46 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
308 | 308 |
| |
309 | 309 |
| |
310 | 310 |
| |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 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 | + | |
311 | 357 |
| |
312 | 358 |
| |
313 | 359 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3769 | 3769 |
| |
3770 | 3770 |
| |
3771 | 3771 |
| |
| 3772 | + | |
3772 | 3773 |
| |
3773 | 3774 |
| |
3774 | 3775 |
| |
|
0 commit comments
Comments
(0)