forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit385cbe8
Handle new HOT chains in index-build table scans
When a table is scanned by heapam_index_build_range_scan (néeIndexBuildHeapScan) and the table lock being held allows concurrent datachanges, it is possible for new HOT chains to sprout in a page that wereunknown when the scan of a page happened. This leads to an error suchas ERROR: failed to find parent tuple for heap-only tuple at (X,Y) in table "tbl"because the root tuple was not present when we first obtained the listof the page's root tuples. This can be fixed by re-obtaining the listof root tuples, if we see that a heap-only tuple appears to point to anon-existing root.This was reported by Anastasia as occurring for BRIN summarization(which exists since 9.5), but I think it could theoretically also happenwith CREATE INDEX CONCURRENTLY (much older) or REINDEX CONCURRENTLY(very recent). It seems a happy coincidence that BRIN forces us tobackpatch this all the way to 9.5.Reported-by: Anastasia Lubennikova <a.lubennikova@postgrespro.ru>Diagnosed-by: Anastasia Lubennikova <a.lubennikova@postgrespro.ru>Co-authored-by: Anastasia Lubennikova <a.lubennikova@postgrespro.ru>Co-authored-by: Álvaro Herrera <alvherre@alvh.no-ip.org>Discussion:https://postgr.es/m/602d8487-f0b2-5486-0088-0f372b2549fa@postgrespro.ruBackpatch: 9.5 - master1 parent721ef4d commit385cbe8
2 files changed
+23
-2
lines changedLines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
730 | 730 |
| |
731 | 731 |
| |
732 | 732 |
| |
733 |
| - | |
| 733 | + | |
734 | 734 |
| |
735 | 735 |
| |
736 | 736 |
| |
| |||
745 | 745 |
| |
746 | 746 |
| |
747 | 747 |
| |
748 |
| - | |
| 748 | + | |
| 749 | + | |
749 | 750 |
| |
750 | 751 |
| |
751 | 752 |
| |
|
Lines changed: 20 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2409 | 2409 |
| |
2410 | 2410 |
| |
2411 | 2411 |
| |
| 2412 | + | |
| 2413 | + | |
| 2414 | + | |
| 2415 | + | |
| 2416 | + | |
| 2417 | + | |
2412 | 2418 |
| |
2413 | 2419 |
| |
2414 | 2420 |
| |
| |||
2679 | 2685 |
| |
2680 | 2686 |
| |
2681 | 2687 |
| |
| 2688 | + | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
2682 | 2702 |
| |
2683 | 2703 |
| |
2684 | 2704 |
| |
|
0 commit comments
Comments
(0)