- Notifications
You must be signed in to change notification settings - Fork4.9k
Commita811ea5
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 parentb8443ea commita811ea5
2 files changed
+23
-2
lines changedLines changed: 20 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1324 | 1324 |
| |
1325 | 1325 |
| |
1326 | 1326 |
| |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
1327 | 1333 |
| |
1328 | 1334 |
| |
1329 | 1335 |
| |
| |||
1625 | 1631 |
| |
1626 | 1632 |
| |
1627 | 1633 |
| |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
1628 | 1648 |
| |
1629 | 1649 |
| |
1630 | 1650 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
855 | 855 |
| |
856 | 856 |
| |
857 | 857 |
| |
858 |
| - | |
| 858 | + | |
859 | 859 |
| |
860 | 860 |
| |
861 | 861 |
| |
| |||
870 | 870 |
| |
871 | 871 |
| |
872 | 872 |
| |
873 |
| - | |
| 873 | + | |
| 874 | + | |
874 | 875 |
| |
875 | 876 |
| |
876 | 877 |
| |
|
0 commit comments
Comments
(0)