From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@postgresql.org
Subject: Re: Buildfarm failure and dubious coding in predicate.c
Date: Sat, 22 Jul 2017 16:32:39 -0400
Message-ID: <21591.1500755559@sss.pgh.pa.us> (raw)
In-Reply-To: <10593.1500670709@sss.pgh.pa.us>
References: <10593.1500670709@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
I wrote:
> And, while I'm looking at this ... isn't this "scratch target" logic
> just an ineffective attempt at waving a dead chicken? It's assuming
> that freeing an entry in a shared hash table guarantees that it can
> insert another entry. But that hash table is partitioned, meaning it has
> a separate freelist per partition. So the extra entry only provides a
> guarantee that you can insert something into the same partition it's in,
> making it useless for this purpose AFAICS.
After further study I found the bit in get_hash_entry() about "borrowing"
entries from other freelists. That makes all of this safe after all,
which is a good thing because I'd also found other assumptions that would
have been broken by the behavior I posited above. But I think that that
code is desperately undercommented -- the reader could be forgiven for
thinking that it was an optional optimization, and not something that
is critical for correctness of several different callers. I'm going to
go improve the comments.
Meanwhile, it's still pretty unclear what happened yesterday on
culicidae.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: Buildfarm failure and dubious coding in predicate.c
In-Reply-To: <21591.1500755559@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