Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dZ14y-0005Vv-Dx for pgsql-hackers@arkaria.postgresql.org; Sat, 22 Jul 2017 20:32:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dZ14x-0002Pb-1u for pgsql-hackers@arkaria.postgresql.org; Sat, 22 Jul 2017 20:32:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dZ14u-0002OT-RS for pgsql-hackers@postgresql.org; Sat, 22 Jul 2017 20:32:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dZ14r-0003z3-G8 for pgsql-hackers@postgresql.org; Sat, 22 Jul 2017 20:32:43 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v6MKWdr8021592 for ; Sat, 22 Jul 2017 16:32:39 -0400 From: Tom Lane To: pgsql-hackers@postgresql.org Subject: Re: Buildfarm failure and dubious coding in predicate.c In-reply-to: <10593.1500670709@sss.pgh.pa.us> References: <10593.1500670709@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 21 Jul 2017 16:58:29 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21590.1500755559.1@sss.pgh.pa.us> Date: Sat, 22 Jul 2017 16:32:39 -0400 Message-ID: <21591.1500755559@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org 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