forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9dbf8ab
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 parent34221af commit9dbf8ab
File tree
7 files changed
+86
-18
lines changed- src
- backend
- access/transam
- storage/ipc
- include/storage
- test/recovery/t
- tools/pgindent
7 files changed
+86
-18
lines changedLines changed: 3 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1986 | 1986 |
| |
1987 | 1987 |
| |
1988 | 1988 |
| |
1989 |
| - | |
1990 |
| - | |
1991 |
| - | |
| 1989 | + | |
| 1990 | + | |
1992 | 1991 |
| |
1993 | 1992 |
| |
1994 | 1993 |
| |
| |||
2008 | 2007 |
| |
2009 | 2008 |
| |
2010 | 2009 |
| |
2011 |
| - | |
| 2010 | + | |
2012 | 2011 |
| |
2013 | 2012 |
| |
2014 | 2013 |
| |
|
Lines changed: 8 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7283 | 7283 |
| |
7284 | 7284 |
| |
7285 | 7285 |
| |
| 7286 | + | |
| 7287 | + | |
| 7288 | + | |
7286 | 7289 |
| |
7287 | 7290 |
| |
7288 | 7291 |
| |
| |||
7291 | 7294 |
| |
7292 | 7295 |
| |
7293 | 7296 |
| |
7294 |
| - | |
| 7297 | + | |
7295 | 7298 |
| |
7296 | 7299 |
| |
7297 | 7300 |
| |
| |||
7301 | 7304 |
| |
7302 | 7305 |
| |
7303 | 7306 |
| |
7304 |
| - | |
7305 |
| - | |
7306 | 7307 |
| |
7307 | 7308 |
| |
7308 | 7309 |
| |
| |||
10424 | 10425 |
| |
10425 | 10426 |
| |
10426 | 10427 |
| |
| 10428 | + | |
| 10429 | + | |
| 10430 | + | |
10427 | 10431 |
| |
10428 | 10432 |
| |
10429 | 10433 |
| |
| |||
10432 | 10436 |
| |
10433 | 10437 |
| |
10434 | 10438 |
| |
10435 |
| - | |
| 10439 | + | |
10436 | 10440 |
| |
10437 | 10441 |
| |
10438 | 10442 |
| |
| |||
10442 | 10446 |
| |
10443 | 10447 |
| |
10444 | 10448 |
| |
10445 |
| - | |
10446 |
| - | |
10447 | 10449 |
| |
10448 | 10450 |
| |
10449 | 10451 |
| |
|
Lines changed: 15 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1108 | 1108 |
| |
1109 | 1109 |
| |
1110 | 1110 |
| |
1111 |
| - | |
| 1111 | + | |
1112 | 1112 |
| |
1113 | 1113 |
| |
1114 | 1114 |
| |
| |||
1260 | 1260 |
| |
1261 | 1261 |
| |
1262 | 1262 |
| |
1263 |
| - | |
| 1263 | + | |
1264 | 1264 |
| |
1265 | 1265 |
| |
1266 | 1266 |
| |
| |||
1272 | 1272 |
| |
1273 | 1273 |
| |
1274 | 1274 |
| |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
1275 | 1287 |
| |
1276 | 1288 |
| |
1277 | 1289 |
| |
| |||
2898 | 2910 |
| |
2899 | 2911 |
| |
2900 | 2912 |
| |
2901 |
| - | |
| 2913 | + | |
2902 | 2914 |
| |
2903 | 2915 |
| |
2904 | 2916 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1130 | 1130 |
| |
1131 | 1131 |
| |
1132 | 1132 |
| |
1133 |
| - | |
| 1133 | + | |
1134 | 1134 |
| |
1135 | 1135 |
| |
1136 | 1136 |
| |
| |||
1286 | 1286 |
| |
1287 | 1287 |
| |
1288 | 1288 |
| |
1289 |
| - | |
| 1289 | + | |
1290 | 1290 |
| |
1291 | 1291 |
| |
1292 | 1292 |
| |
| |||
1303 | 1303 |
| |
1304 | 1304 |
| |
1305 | 1305 |
| |
1306 |
| - | |
| 1306 | + | |
1307 | 1307 |
| |
1308 | 1308 |
| |
1309 | 1309 |
| |
|
Lines changed: 9 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
74 | 74 |
| |
75 | 75 |
| |
76 | 76 |
| |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
77 | 85 |
| |
78 | 86 |
| |
79 | 87 |
| |
80 | 88 |
| |
81 |
| - | |
| 89 | + | |
82 | 90 |
| |
83 | 91 |
| |
84 | 92 |
| |
|
Lines changed: 47 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
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 | |
---|---|---|---|
| |||
3558 | 3558 |
| |
3559 | 3559 |
| |
3560 | 3560 |
| |
| 3561 | + | |
3561 | 3562 |
| |
3562 | 3563 |
| |
3563 | 3564 |
| |
|
0 commit comments
Comments
(0)