pgsql: Handle new HOT chains in index-build table scans
От | Alvaro Herrera |
---|---|
Тема | pgsql: Handle new HOT chains in index-build table scans |
Дата | |
Msg-id | E1k6L5g-0000Uf-BE@gemulon.postgresql.org обсуждение исходный текст |
Список | pgsql-committers |
Handle new HOT chains in index-build table scans When a table is scanned by heapam_index_build_range_scan (née IndexBuildHeapScan) and the table lock being held allows concurrent data changes, it is possible for new HOT chains to sprout in a page that were unknown when the scan of a page happened. This leads to an error such as 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 list of the page's root tuples. This can be fixed by re-obtaining the list of root tuples, if we see that a heap-only tuple appears to point to a non-existing root. This was reported by Anastasia as occurring for BRIN summarization (which exists since 9.5), but I think it could theoretically also happen with CREATE INDEX CONCURRENTLY (much older) or REINDEX CONCURRENTLY (very recent). It seems a happy coincidence that BRIN forces us to backpatch 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.ru Backpatch: 9.5 - master Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/385cbe8e4197fd46c34a9142f2dee2ed664f0c7e Modified Files -------------- src/backend/access/heap/pruneheap.c | 5 +++-- src/backend/catalog/index.c | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-)
В списке pgsql-committers по дате отправления: