forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2f29fd4
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 parent8782ea2 commit2f29fd4
2 files changed
+23
-2
lines changedLines changed: 20 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1322 | 1322 |
| |
1323 | 1323 |
| |
1324 | 1324 |
| |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
1325 | 1331 |
| |
1326 | 1332 |
| |
1327 | 1333 |
| |
| |||
1623 | 1629 |
| |
1624 | 1630 |
| |
1625 | 1631 |
| |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
1626 | 1646 |
| |
1627 | 1647 |
| |
1628 | 1648 |
| |
|
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)