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: pgsql-hackers@lists.postgresql.org
Date: 2020-07-27T17:25:29Z
Lists: pgsql-hackers
On 2020-Jul-27, Anastasia Lubennikova wrote:
> Here is the updated version of the fix.
> The problem can be reproduced on all supported versions, so I suggest to
> backpatch it.
> Code slightly changed in v12, so here are two patches: one for versions 9.5
> to 11 and another for versions from 12 to master.
Hi Anastasia, thanks for this report and fix. I was considering this
last week and noticed that the patch changes the ABI of
heap_get_root_tuples, which may be problematic in back branches. I
suggest that for unreleased branches (12 and prior) we need to create a
new function with the new signature, and keep heap_get_root_tuples
unchanged. In 13 and master we don't need that trick, so we can keep
the code as you have it in this version of the patch.
OffsetNumber
heap_get_root_tuples_new(Page page, OffsetNumber *root_offsets)
{ .. full implementation ... }
/* ABI compatibility only */
void
heap_get_root_tuples(Page page, OffsetNumber *root_offsets)
{
(void) heap_get_root_tuples_new(page, root_offsets);
}
(I was also considering whether it needs to be a loop to reobtain root
tuples, in case a concurrent transaction can create a new item while
we're checking that item; but I don't think that can really happen for
one individual tuple.)
Thanks
--
Á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