From: | Peter Geoghegan <pg(at)bowt(dot)ie> |
---|---|
To: | Alexander Korotkov <aekorotkov(at)gmail(dot)com> |
Cc: | Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Pawel Kudzia <kudzia(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Subject: | Re: IRe: BUG #16792: silent corruption of GIN index resulting in SELECTs returning non-matching rows |
Date: | 2021-07-16 23:40:05 |
Message-ID: | CAH2-WzmqCtkxBrxB09RGmvpG0k52son1GOg_Ua+TDtFUQsTTDg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
On Thu, Jul 15, 2021 at 3:56 AM Alexander Korotkov <aekorotkov(at)gmail(dot)com> wrote:
> I still think this is worth checking. Despite the pending list wasn't
> involved in the index scan with wrong results, the bug could be
> related to insertion to the pending list. Or it could be related to
> moving entries from the pending list to the posting list/tree.
If I had to guess I'd say that the chances of the pending list being
involved are high.
shiftList() deletes pages in the pending list -- this is called from
ginInsertCleanup(). But shiftList() doesn't call GinPageSetDeleteXid()
to set an XID that represents when the page is safe to recycle, which
is what ginDeletePage() always does. Why is that okay?
Note that we usually use read/share buffer locks when lock-coupling
inside ginInsertCleanup() -- so AFAICT we won't block-out concurrent
readers with a link that's about to go stale due to recycling of the
page. This looks unsafe. Of course it's very hard to tell what might
be going on, since none of this seems to be explained anywhere.
Even ginDeletePage() didn't do the right thing with XIDs until bugfix
commit 52ac6cd2d0. That commit didn't touch any pending list code --
it should of at least explained why ginInsertCleanup()/shiftList()
don't need to use the GinPageSetDeleteXid() stuff.
--
Peter Geoghegan
From | Date | Subject | |
---|---|---|---|
Next Message | Japin Li | 2021-07-17 00:11:28 | Re: BUG #17111: Database created, cannot be created, but reported as inexist |
Previous Message | Alvaro Herrera | 2021-07-16 18:09:33 | Re: BUG #17103: WAL segments are not removed after exceeding max_slot_wal_keep_size |