Re: BUG #17949: Adding an index introduces serialisation anomalies.

Artem Anisimov <artem.anisimov.255@gmail.com>

From: Artem Anisimov <artem.anisimov.255@gmail.com>
To: Thomas Munro <thomas.munro@gmail.com>, Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Dmitry Dolgov <9erthalion6@gmail.com>, pgsql-bugs@lists.postgresql.org, Teodor Sigaev <teodor@sigaev.ru>
Date: 2023-07-14T13:05:51Z
Lists: pgsql-bugs
Hi Thomas,


thank you for the fixes. I've looked up the patches in pg's git repo, 
and they got me wondering: where is the repo with pg tests? I'd be 
really uneasy to make changes to concurrency-related code without a 
decent testsuite to verify them.


Best regards,

Artem.


On 04/07/2023 01:02, Thomas Munro wrote:
> On Wed, Jun 28, 2023 at 3:18 PM Thomas Munro <thomas.munro@gmail.com> wrote:
>> I'll push these in a couple of days if there are no further comments.
> Done.
>
> Thanks Artem, Dmitry and Heikki.
>
> I wonder how we might be more systematic about this.  There are some
> general principles that were not respected here, but I'm not sure if
> they're even written down let alone defended with code.  Something to
> think about.
>
> It's not great to add a new use of BufferGetBlockNumber() (in terms of
> false sharing just to get a value that we must have had moment earlier
> in order to pin the buffer), but we do that all the time.  That seems
> like a micro-optimisation worth looking into in some systematic way
> across all AMs.



Commits

  1. Fix race in SSI interaction with bitmap heap scan.

  2. Fix race in SSI interaction with gin fast path.

  3. Fix race in SSI interaction with empty btrees.

  4. Re-think predicate locking on GIN indexes.