forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite9c8747
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 parent071e19a commite9c8747
File tree
7 files changed
+85
-18
lines changed- src
- backend
- access/transam
- storage/ipc
- include/storage
- test/recovery/t
- tools/pgindent
7 files changed
+85
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1997 | 1997 | | |
1998 | 1998 | | |
1999 | 1999 | | |
2000 | | - | |
2001 | | - | |
2002 | | - | |
| 2000 | + | |
| 2001 | + | |
2003 | 2002 | | |
2004 | 2003 | | |
2005 | 2004 | | |
| |||
2019 | 2018 | | |
2020 | 2019 | | |
2021 | 2020 | | |
2022 | | - | |
| 2021 | + | |
2023 | 2022 | | |
2024 | 2023 | | |
2025 | 2024 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7134 | 7134 | | |
7135 | 7135 | | |
7136 | 7136 | | |
| 7137 | + | |
| 7138 | + | |
| 7139 | + | |
7137 | 7140 | | |
7138 | 7141 | | |
7139 | 7142 | | |
| |||
7142 | 7145 | | |
7143 | 7146 | | |
7144 | 7147 | | |
7145 | | - | |
| 7148 | + | |
7146 | 7149 | | |
7147 | 7150 | | |
7148 | 7151 | | |
| |||
7152 | 7155 | | |
7153 | 7156 | | |
7154 | 7157 | | |
7155 | | - | |
7156 | | - | |
7157 | 7158 | | |
7158 | 7159 | | |
7159 | 7160 | | |
| |||
10217 | 10218 | | |
10218 | 10219 | | |
10219 | 10220 | | |
| 10221 | + | |
| 10222 | + | |
| 10223 | + | |
10220 | 10224 | | |
10221 | 10225 | | |
10222 | 10226 | | |
| |||
10225 | 10229 | | |
10226 | 10230 | | |
10227 | 10231 | | |
10228 | | - | |
| 10232 | + | |
10229 | 10233 | | |
10230 | 10234 | | |
10231 | 10235 | | |
| |||
10235 | 10239 | | |
10236 | 10240 | | |
10237 | 10241 | | |
10238 | | - | |
10239 | | - | |
10240 | 10242 | | |
10241 | 10243 | | |
10242 | 10244 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
734 | 734 | | |
735 | 735 | | |
736 | 736 | | |
737 | | - | |
| 737 | + | |
738 | 738 | | |
739 | 739 | | |
740 | 740 | | |
| |||
886 | 886 | | |
887 | 887 | | |
888 | 888 | | |
889 | | - | |
| 889 | + | |
890 | 890 | | |
891 | 891 | | |
892 | 892 | | |
| |||
898 | 898 | | |
899 | 899 | | |
900 | 900 | | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
901 | 913 | | |
902 | 914 | | |
903 | 915 | | |
| |||
2129 | 2141 | | |
2130 | 2142 | | |
2131 | 2143 | | |
2132 | | - | |
| 2144 | + | |
2133 | 2145 | | |
2134 | 2146 | | |
2135 | 2147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
937 | 937 | | |
938 | 938 | | |
939 | 939 | | |
940 | | - | |
| 940 | + | |
941 | 941 | | |
942 | 942 | | |
943 | 943 | | |
| |||
1093 | 1093 | | |
1094 | 1094 | | |
1095 | 1095 | | |
1096 | | - | |
| 1096 | + | |
1097 | 1097 | | |
1098 | 1098 | | |
1099 | 1099 | | |
| |||
1110 | 1110 | | |
1111 | 1111 | | |
1112 | 1112 | | |
1113 | | - | |
| 1113 | + | |
1114 | 1114 | | |
1115 | 1115 | | |
1116 | 1116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
70 | 78 | | |
71 | 79 | | |
72 | 80 | | |
73 | 81 | | |
74 | | - | |
| 82 | + | |
75 | 83 | | |
76 | 84 | | |
77 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
| 308 | + | |
| 309 | + | |
| 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 | + | |
308 | 353 | | |
309 | 354 | | |
310 | 355 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3373 | 3373 | | |
3374 | 3374 | | |
3375 | 3375 | | |
| 3376 | + | |
3376 | 3377 | | |
3377 | 3378 | | |
3378 | 3379 | | |
| |||
0 commit comments
Comments
(0)