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

Amit Kapila
Fix decoding of speculative aborts.
During decoding for speculative inserts, we were relying for cleaningtoast hash on confirmation records or next change records. But thatcould lead to multiple problems (a) memory leak if there is neither aconfirmation record nor any other record after toast insertion for aspeculative insert in the transaction, (b) error and assertion failuresif the next operation is not an insert/update on the same table.The fix is to start queuing spec abort change and clean up toast hashand change record during its processing. Currently, we are queuing thespec aborts for both toast and main table even though we perform cleanupwhile processing the main table's spec abort record. Later, if we have away to distinguish between the spec abort record of toast and the maintable, we can avoid queuing the change for spec aborts of toast tables.Reported-by: Ashutosh BapatAuthor: Dilip KumarReviewed-by: Amit KapilaBackpatch-through: 9.6, where it was introducedDiscussion:https://postgr.es/m/CAExHW5sPKF-Oovx_qZe4p5oM6Dvof7_P+XgsNAViug15Fm99jA@mail.gmail.com1 parent0a1e80c commit4daa140
File tree
3 files changed
+48
-24
lines changed- src
- backend/replication/logical
- include/replication
3 files changed
+48
-24
lines changedLines changed: 6 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1040 | 1040 |
| |
1041 | 1041 |
| |
1042 | 1042 |
| |
1043 |
| - | |
1044 |
| - | |
1045 |
| - | |
1046 |
| - | |
1047 |
| - | |
1048 |
| - | |
1049 |
| - | |
1050 | 1043 |
| |
1051 | 1044 |
| |
1052 | 1045 |
| |
1053 | 1046 |
| |
1054 | 1047 |
| |
1055 |
| - | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
1056 | 1054 |
| |
1057 | 1055 |
| |
1058 | 1056 |
| |
|
Lines changed: 37 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
443 | 443 |
| |
444 | 444 |
| |
445 | 445 |
| |
| 446 | + | |
| 447 | + | |
| 448 | + | |
446 | 449 |
| |
447 | 450 |
| |
448 | 451 |
| |
| |||
520 | 523 |
| |
521 | 524 |
| |
522 | 525 |
| |
| 526 | + | |
523 | 527 |
| |
524 | 528 |
| |
525 | 529 |
| |
| |||
2211 | 2215 |
| |
2212 | 2216 |
| |
2213 | 2217 |
| |
2214 |
| - | |
2215 |
| - | |
| 2218 | + | |
| 2219 | + | |
2216 | 2220 |
| |
2217 | 2221 |
| |
2218 | 2222 |
| |
| |||
2254 | 2258 |
| |
2255 | 2259 |
| |
2256 | 2260 |
| |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
2257 | 2287 |
| |
2258 | 2288 |
| |
2259 | 2289 |
| |
| |||
2360 | 2390 |
| |
2361 | 2391 |
| |
2362 | 2392 |
| |
2363 |
| - | |
2364 |
| - | |
2365 |
| - | |
2366 |
| - | |
2367 |
| - | |
2368 |
| - | |
2369 |
| - | |
2370 |
| - | |
2371 |
| - | |
2372 |
| - | |
| 2393 | + | |
| 2394 | + | |
2373 | 2395 |
| |
2374 | 2396 |
| |
2375 | 2397 |
| |
| |||
3754 | 3776 |
| |
3755 | 3777 |
| |
3756 | 3778 |
| |
| 3779 | + | |
3757 | 3780 |
| |
3758 | 3781 |
| |
3759 | 3782 |
| |
| |||
4017 | 4040 |
| |
4018 | 4041 |
| |
4019 | 4042 |
| |
| 4043 | + | |
4020 | 4044 |
| |
4021 | 4045 |
| |
4022 | 4046 |
| |
| |||
4315 | 4339 |
| |
4316 | 4340 |
| |
4317 | 4341 |
| |
| 4342 | + | |
4318 | 4343 |
| |
4319 | 4344 |
| |
4320 | 4345 |
| |
|
Lines changed: 5 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
49 |
| - | |
50 |
| - | |
51 |
| - | |
52 |
| - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
| |||
63 | 63 |
| |
64 | 64 |
| |
65 | 65 |
| |
| 66 | + | |
66 | 67 |
| |
67 | 68 |
| |
68 | 69 |
| |
|
0 commit comments
Comments
(0)