pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrey Borodin <x4mmm@yandex-team.ru>
Cc: Pavel Borisov <pashkin.elfe@gmail.com>
Cc: Alexander Lakhin <exclusion@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16329: Valgrind detects an invalid read when building a gist index with buffering
Date: Thu, 22 Oct 2020 10:01:57 -0400
Message-ID: <275237.1603375317@sss.pgh.pa.us> (raw)
In-Reply-To: <0931D3ED-77BA-407C-8C5B-2FBD624ED3A0@yandex-team.ru>
References: <16329-7a6aa9b6fa1118a1@postgresql.org>
	<ca1f896b-e5d1-53a7-5bc3-9451ab9aca22@gmail.com>
	<e91e45fd-a614-bb87-e9fc-c556c2b95fe5@gmail.com>
	<3dda6945-c147-5afc-7720-38ec6848dafa@gmail.com>
	<10261.1588705157@sss.pgh.pa.us>
	<93ca4540-0016-8217-2b31-535613499987@gmail.com>
	<06f117b8-bbc1-4190-d204-ef329121cbca@gmail.com>
	<CALT9ZEECCV5m7wvxg46PC-7x-EybUmnpupBGhSFMoAAay+r6HQ@mail.gmail.com>
	<3395318.1602541012@sss.pgh.pa.us>
	<0931D3ED-77BA-407C-8C5B-2FBD624ED3A0@yandex-team.ru>

Andrey Borodin <x4mmm@yandex-team.ru> writes:
>> 13 окт. 2020 г., в 03:16, Tom Lane <tgl@sss.pgh.pa.us> написал(а):
>> 2. The test exposed the gistRelocateBuildBuffersOnSplit bug only about
>> one time in ten for me.  I suppose this is due to the random split
>> choices gistchoose makes for equally-good tuples, so it's not terribly
>> surprising; but it is problematic for a test that we're hoping to use
>> to provide reliable code coverage.
>> 
>> I'm not really sure what we could do about #2.  Perhaps, instead of
>> relying on random(), we could make gistchoose() use our own PRNG and
>> then invent a debugging function that forces the seed to a known value.
>> (GEQO already does something similar, although I'd not go as far as
>> exposing the seed as a GUC.  Resetting it via some quick-hack C
>> function in regress.c would be enough IMO.)  Or perhaps gist.sql could
>> be adjusted so that the test data is less full of equally-good tuples.

> I think we should use not entropy-based tie breaker in GiST. We can extract some randomness from tuples using hash.
> I'd be much happier if GiST behaviour was deterministic.

If we started using our own PRNG, we could very easily make the "random"
sequence be the same in every GiST build --- again, see GEQO for prior
art.  I'm a little suspicious of trying to pull some entropy out of the
tuples themselves: that seems like it'd be tremendously prone to cross-
platform and cross-version behavioral differences.

			regards, tom lane





view thread (20+ messages)  latest in thread

Message-ID: <275237.1603375317@sss.pgh.pa.us>
Permalink:  ../275237.1603375317@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/275237.1603375317@sss.pgh.pa.us

 · 

reply

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, x4mmm@yandex-team.ru, pashkin.elfe@gmail.com, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #16329: Valgrind detects an invalid read when building a gist index with buffering
  In-Reply-To: <275237.1603375317@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