Re: [BUG] Error in BRIN summarization
Alvaro Herrera <alvherre@2ndquadrant.com>
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Anastasia Lubennikova <a.lubennikova@postgrespro.ru>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-08-12T00:19:52Z
Lists: pgsql-hackers
Attachments
- hot-summarization.patch (text/x-diff) patch
On 2020-Jul-23, Anastasia Lubennikova wrote: > This error is caused by the problem with root_offsets array bounds. It > occurs if a new HOT tuple was inserted after we've collected root_offsets, > and thus we don't have root_offset for tuple's offnum. Concurrent insertions > are possible, because brin_summarize_new_values() only holds ShareUpdateLock > on table and no lock (only pin) on the page. Excellent detective work, thanks. > The draft fix is in the attachments. It saves root_offsets_size and checks > that we only access valid fields. I think this is more complicated than necessary. It seems easier to solve this problem by just checking whether the given root pointer is set to InvalidOffsetNumber, which is already done in the existing coding of heap_get_root_tuples (only they spell it "0" rather than InvalidOffsetNumber, which I propose to change). AFAIR this should only happen in the 'anyvisible' mode, so I added that in an assert. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Disable autovacuum for BRIN test table
- b83f1bcca0bb 13.0 landed
- 6e70443edacf 14.0 landed
- 4f47c8e7d438 12.5 landed
- 060e5bd70e4d 11.10 landed
- d4d21490376e 9.6.20 landed
- aa4da2674ca2 9.5.24 landed
- 3a45ac076aab 10.15 landed
-
Handle new HOT chains in index-build table scans
- e5902117dd83 9.6.20 landed
- a811ea5bde2f 14.0 landed
- 704de3739c5b 11.10 landed
- 40bceae7b4de 9.5.24 landed
- 385cbe8e4197 10.15 landed
- 2f29fd4cb252 13.0 landed
- 1122a903e967 12.5 landed
-
BRIN: Handle concurrent desummarization properly
- ce3a8fde8e62 9.5.24 landed
- 8782ea2f36a2 13.0 landed
- 7af39993a47c 11.10 landed
- 7a3c261fbbb4 9.6.20 landed
- 721ef4d28aae 10.15 landed
- 1f42d35a1d61 14.0 landed
- 0426c75e7d1d 12.5 landed