Re: BUG #17949: Adding an index introduces serialisation anomalies. - Mailing list pgsql-bugs

From Dmitry Dolgov
Subject Re: BUG #17949: Adding an index introduces serialisation anomalies.
Date
Msg-id 20230621085812.idputjd7w3ejjih3@ddolgov.remote.csb
Whole thread Raw
In response to Re: BUG #17949: Adding an index introduces serialisation anomalies.  (Thomas Munro <thomas.munro@gmail.com>)
List pgsql-bugs
> On Tue, Jun 20, 2023 at 01:22:19PM +1200, Thomas Munro wrote:
> On Tue, Jun 20, 2023 at 12:18 AM Dmitry Dolgov <9erthalion6@gmail.com> wrote:
> > > On Mon, Jun 19, 2023 at 09:30:12PM +1200, Thomas Munro wrote:
> > > +#if 0
> > >         /*
> > >          * Ignore any claimed entries past what we think is the end of the
> > >          * relation. It may have been extended after the start of our scan (we
> > >          * only hold an AccessShareLock, and it could be inserts from this
> > >          * backend).
> > >          */
> > >         if (block >= hscan->rs_nblocks)
> > >                 return false;
> > > +#endif
> >
> > Great, thanks! Can confirm, after applying both the posted patch and the
> > change above the issue is not reproducible anymore.
>
> Here's a cleaned-up version of the first two changes.  What do you
> think about the assertions I make in the commit message for 0002?

Yep, it sounds correct to me. After a quick look I couldn't find where
exactly the similar code lives in the pre-tableam version, so can't say
anything about back-patching there.



pgsql-bugs by date:

Previous
From: Zu-Ming Jiang
Date:
Subject: Re: BUG #17986: Inconsistent results of SELECT affected by btree index
Next
From: Dmitry Dolgov
Date:
Subject: Re: BUG #17949: Adding an index introduces serialisation anomalies.