forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf16241b
committed
Raise error when affecting tuple moved into different partition.
When an update moves a row between partitions (supported since2f17844), our normal logic for following update chains in READCOMMITTED mode doesn't work anymore. Cross partition updates aremodeled as an delete from the old and insert into the newpartition. No ctid chain exists across partitions, and there's noconvenient space to introduce that link.Not throwing an error in a partitioned context when one would havebeen thrown without partitioning is obviously problematic. This commitintroduces infrastructure to detect when a tuple has been moved, notjust plainly deleted. That allows to throw an error when encounteringa deletion that's actually a move, while attempting to following actid chain.The row deleted as part of a cross partition update is marked bypointing it's t_ctid to an invalid block, instead of self as a normalupdate would. That was deemed to be the least invasive and mostfuture proof way to represent the knowledge, given how few infomaskbits are there to be recycled (there's also some locking issues withusing infomask bits).External code following ctid chains should be updated to check formoved tuples. The most likely consequence of not doing so is a missederror.Author: Amul Sul, editorialized by meReviewed-By: Amit Kapila, Pavan Deolasee, Andres Freund, Robert HaasDiscussion:http://postgr.es/m/CAAJ_b95PkwojoYfz0bzXU8OokcTVGzN6vYGCNVUukeUDrnF3dw@mail.gmail.com1 parent8224de4 commitf16241b
File tree
23 files changed
+624
-22
lines changed- src
- backend
- access/heap
- commands
- executor
- include
- access
- executor
- storage
- test/isolation
- expected
- specs
23 files changed
+624
-22
lines changedLines changed: 33 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2308 | 2308 |
| |
2309 | 2309 |
| |
2310 | 2310 |
| |
| 2311 | + | |
2311 | 2312 |
| |
2312 | 2313 |
| |
2313 | 2314 |
| |
| |||
3041 | 3042 |
| |
3042 | 3043 |
| |
3043 | 3044 |
| |
| 3045 | + | |
| 3046 | + | |
3044 | 3047 |
| |
3045 | 3048 |
| |
3046 | 3049 |
| |
| |||
3056 | 3059 |
| |
3057 | 3060 |
| |
3058 | 3061 |
| |
3059 |
| - | |
| 3062 | + | |
3060 | 3063 |
| |
3061 | 3064 |
| |
3062 | 3065 |
| |
| |||
3325 | 3328 |
| |
3326 | 3329 |
| |
3327 | 3330 |
| |
| 3331 | + | |
| 3332 | + | |
| 3333 | + | |
| 3334 | + | |
3328 | 3335 |
| |
3329 | 3336 |
| |
3330 | 3337 |
| |
| |||
3342 | 3349 |
| |
3343 | 3350 |
| |
3344 | 3351 |
| |
3345 |
| - | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
3346 | 3357 |
| |
3347 | 3358 |
| |
3348 | 3359 |
| |
| |||
3450 | 3461 |
| |
3451 | 3462 |
| |
3452 | 3463 |
| |
3453 |
| - | |
| 3464 | + | |
3454 | 3465 |
| |
3455 | 3466 |
| |
3456 | 3467 |
| |
| |||
6051 | 6062 |
| |
6052 | 6063 |
| |
6053 | 6064 |
| |
| 6065 | + | |
6054 | 6066 |
| |
6055 | 6067 |
| |
6056 | 6068 |
| |
| |||
6102 | 6114 |
| |
6103 | 6115 |
| |
6104 | 6116 |
| |
6105 |
| - | |
| 6117 | + | |
| 6118 | + | |
| 6119 | + | |
| 6120 | + | |
| 6121 | + | |
| 6122 | + | |
6106 | 6123 |
| |
6107 | 6124 |
| |
6108 | 6125 |
| |
| |||
8493 | 8510 |
| |
8494 | 8511 |
| |
8495 | 8512 |
| |
8496 |
| - | |
8497 |
| - | |
| 8513 | + | |
| 8514 | + | |
| 8515 | + | |
| 8516 | + | |
| 8517 | + | |
8498 | 8518 |
| |
8499 | 8519 |
| |
8500 | 8520 |
| |
| |||
9422 | 9442 |
| |
9423 | 9443 |
| |
9424 | 9444 |
| |
| 9445 | + | |
| 9446 | + | |
| 9447 | + | |
| 9448 | + | |
| 9449 | + | |
| 9450 | + | |
| 9451 | + | |
9425 | 9452 |
| |
9426 | 9453 |
| |
9427 | 9454 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
552 | 552 |
| |
553 | 553 |
| |
554 | 554 |
| |
| 555 | + | |
| 556 | + | |
| 557 | + | |
555 | 558 |
| |
556 | 559 |
| |
557 | 560 |
| |
| |||
823 | 826 |
| |
824 | 827 |
| |
825 | 828 |
| |
| 829 | + | |
| 830 | + | |
| 831 | + | |
826 | 832 |
| |
827 | 833 |
| |
828 | 834 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
424 | 424 |
| |
425 | 425 |
| |
426 | 426 |
| |
| 427 | + | |
427 | 428 |
| |
428 | 429 |
| |
429 | 430 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3315 | 3315 |
| |
3316 | 3316 |
| |
3317 | 3317 |
| |
| 3318 | + | |
| 3319 | + | |
| 3320 | + | |
| 3321 | + | |
| 3322 | + | |
3318 | 3323 |
| |
3319 | 3324 |
| |
3320 | 3325 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2733 | 2733 |
| |
2734 | 2734 |
| |
2735 | 2735 |
| |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
2736 | 2740 |
| |
2737 | 2741 |
| |
2738 | 2742 |
| |
| |||
2801 | 2805 |
| |
2802 | 2806 |
| |
2803 | 2807 |
| |
| 2808 | + | |
| 2809 | + | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
| 2813 | + | |
| 2814 | + | |
| 2815 | + | |
2804 | 2816 |
| |
2805 | 2817 |
| |
2806 | 2818 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
324 | 324 |
| |
325 | 325 |
| |
326 | 326 |
| |
327 |
| - | |
| 327 | + | |
| 328 | + | |
328 | 329 |
| |
329 | 330 |
| |
330 | 331 |
| |
|
Lines changed: 16 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
191 | 191 |
| |
192 | 192 |
| |
193 | 193 |
| |
194 |
| - | |
195 |
| - | |
196 |
| - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
197 | 202 |
| |
198 | 203 |
| |
199 | 204 |
| |
| |||
349 | 354 |
| |
350 | 355 |
| |
351 | 356 |
| |
352 |
| - | |
353 |
| - | |
354 |
| - | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
355 | 365 |
| |
356 | 366 |
| |
357 | 367 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
218 | 218 |
| |
219 | 219 |
| |
220 | 220 |
| |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
221 | 226 |
| |
222 | 227 |
| |
223 | 228 |
| |
|
Lines changed: 23 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
645 | 645 |
| |
646 | 646 |
| |
647 | 647 |
| |
648 |
| - | |
| 648 | + | |
| 649 | + | |
649 | 650 |
| |
650 | 651 |
| |
651 | 652 |
| |
| |||
744 | 745 |
| |
745 | 746 |
| |
746 | 747 |
| |
747 |
| - | |
| 748 | + | |
| 749 | + | |
748 | 750 |
| |
749 | 751 |
| |
750 | 752 |
| |
| |||
803 | 805 |
| |
804 | 806 |
| |
805 | 807 |
| |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
806 | 812 |
| |
807 | 813 |
| |
808 | 814 |
| |
| |||
1157 | 1163 |
| |
1158 | 1164 |
| |
1159 | 1165 |
| |
1160 |
| - | |
| 1166 | + | |
1161 | 1167 |
| |
1162 | 1168 |
| |
1163 | 1169 |
| |
| |||
1333 | 1339 |
| |
1334 | 1340 |
| |
1335 | 1341 |
| |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
1336 | 1346 |
| |
1337 | 1347 |
| |
1338 | 1348 |
| |
| |||
1522 | 1532 |
| |
1523 | 1533 |
| |
1524 | 1534 |
| |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
1525 | 1543 |
| |
1526 | 1544 |
| |
1527 | 1545 |
| |
| |||
2274 | 2292 |
| |
2275 | 2293 |
| |
2276 | 2294 |
| |
2277 |
| - | |
| 2295 | + | |
| 2296 | + | |
2278 | 2297 |
| |
2279 | 2298 |
| |
2280 | 2299 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
167 | 167 |
| |
168 | 168 |
| |
169 | 169 |
| |
170 |
| - | |
| 170 | + | |
171 | 171 |
| |
172 | 172 |
| |
173 | 173 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
93 | 93 |
| |
94 | 94 |
| |
95 | 95 |
| |
| 96 | + | |
96 | 97 |
| |
97 | 98 |
| |
98 | 99 |
| |
|
Lines changed: 10 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
83 | 83 |
| |
84 | 84 |
| |
85 | 85 |
| |
86 |
| - | |
87 |
| - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
88 | 90 |
| |
89 | 91 |
| |
90 | 92 |
| |
| |||
445 | 447 |
| |
446 | 448 |
| |
447 | 449 |
| |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
448 | 456 |
| |
449 | 457 |
| |
450 | 458 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
30 |
| - | |
| 30 | + | |
| 31 | + | |
31 | 32 |
| |
32 | 33 |
| |
33 | 34 |
| |
|
Lines changed: 16 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
154 | 154 |
| |
155 | 155 |
| |
156 | 156 |
| |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
157 | 173 |
| |
158 | 174 |
| |
159 | 175 |
| |
|
0 commit comments
Comments
(0)