forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1122a90
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 parent0426c75 commit1122a90
2 files changed
+23
-2
lines changedLines changed: 20 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1341 | 1341 |
| |
1342 | 1342 |
| |
1343 | 1343 |
| |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
1344 | 1350 |
| |
1345 | 1351 |
| |
1346 | 1352 |
| |
| |||
1643 | 1649 |
| |
1644 | 1650 |
| |
1645 | 1651 |
| |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
1646 | 1666 |
| |
1647 | 1667 |
| |
1648 | 1668 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
732 | 732 |
| |
733 | 733 |
| |
734 | 734 |
| |
735 |
| - | |
| 735 | + | |
736 | 736 |
| |
737 | 737 |
| |
738 | 738 |
| |
| |||
747 | 747 |
| |
748 | 748 |
| |
749 | 749 |
| |
750 |
| - | |
| 750 | + | |
| 751 | + | |
751 | 752 |
| |
752 | 753 |
| |
753 | 754 |
| |
|
0 commit comments
Comments
(0)