Re: [BUG] Error in BRIN summarization

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Anastasia Lubennikova <a(dot)lubennikova(at)postgrespro(dot)ru>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [BUG] Error in BRIN summarization
Date: 2020-08-12 18:02:18
Message-ID: 20200812180218.GA30467@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2020-Aug-11, Alvaro Herrera wrote:

> A much more troubling thought is what happens if the range is
> desummarized, then the index item is used for the summary of a different
> range. Then the index might end up returning corrupt results.

Actually, this is not a concern because the brin tuple's bt_blkno is
rechecked before returning it, and if it doesn't match what we're
searching, the loop is restarted. It becomes an infinite loop problem
if the revmap is pointing to a tuple that's labelled with a different
range's blkno. So I think my patch as posted is a sufficient fix for
this problem.

Álvaro Herrera
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marco Atzeri 2020-08-12 18:31:06 ltree_plpython failure test on Cygwin for 12.4 test
Previous Message Tom Lane 2020-08-12 18:00:55 Re: Parallel query hangs after a smart shutdown is issued