From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexander Korotkov <aekorotkov@gmail.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Pawel Kudzia <kudzia@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #16792: silent corruption of GIN index resulting in SELECTs returning non-matching rows
Date: Thu, 17 Jun 2021 18:04:08 -0400
Message-ID: <1068521.1623967448@sss.pgh.pa.us> (raw)
In-Reply-To: <CAPpHfdt5seb3UC7M8nGpNURSV=LqqBWaSs3To3YV_pxUXjA8Qg@mail.gmail.com>
References: <16792-b1913b6b4e098331@postgresql.org>
<CAJYBUS9AaEgFTXnZnAWir993-MOVLnXefQmyLd9erXewZhXiHA@mail.gmail.com>
<CAJYBUS_5Z+9aHyNQ7wkTEkZF+c_RMn7hMjPkTGU0Uc7OHMU3sQ@mail.gmail.com>
<CAJYBUS8p3aYh5ZWJHHk1QGnGkUepMHQMMm87kODoXOFS+VWVGQ@mail.gmail.com>
<970432.1623938874@sss.pgh.pa.us>
<1039976.1623959387@sss.pgh.pa.us>
<CAPpHfdt5seb3UC7M8nGpNURSV=LqqBWaSs3To3YV_pxUXjA8Qg@mail.gmail.com>
Alexander Korotkov <aekorotkov@gmail.com> writes:
> On Thu, Jun 17, 2021 at 10:49 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> we need to add some code that checks for default searchMode, and in
>> that case doesn't call the consistentFn unless at least one
>> (non-MAYBE) input is TRUE.
> I think in default search mode we can just start with curResult equal
> to GIN_FALSE instead of calling directBoolConsistentFn().
No, it's not that simple, because there might be other keys that are
TRUE not MAYBE. So the result could legitimately be TRUE in this case.
BTW, I think it'd be a really good idea for this function to restore
all the MAYBE entries to GIN_MAYBE before returning, so that you can
remove the caveat that it destroys the contents of entryRes[]. I have
basically zero faith that that's safe, and it seems pretty cheap to
not have to make the assumption.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, aekorotkov@gmail.com, hlinnaka@iki.fi, kudzia@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16792: silent corruption of GIN index resulting in SELECTs returning non-matching rows
In-Reply-To: <1068521.1623967448@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox