Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ehhWZ-00035a-TG for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Feb 2018 20:01:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehhWY-00087U-8f for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Feb 2018 20:01:26 +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 1ehhWY-00087K-1w for pgsql-hackers@lists.postgresql.org; Fri, 02 Feb 2018 20:01:26 +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.89) (envelope-from ) id 1ehhWQ-0002HO-U8 for pgsql-hackers@postgresql.org; Fri, 02 Feb 2018 20:01:25 +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 w12K1FH3003648; Fri, 2 Feb 2018 15:01:15 -0500 From: Tom Lane To: Robert Haas cc: Dilip Kumar , Thomas Munro , Jakub Glapa , pgsql-hackers Subject: Re: ERROR: too many dynamic shared memory segments In-reply-to: References: Comments: In-reply-to Robert Haas message dated "Tue, 28 Nov 2017 11:58:53 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3646.1517601675.1@sss.pgh.pa.us> Date: Fri, 02 Feb 2018 15:01:15 -0500 Message-ID: <3647.1517601675@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Robert Haas writes: > That turned out to produce more than one problem. I find that the > select_parallel test then fails like this: > ERROR: could not find key 18446744073709486082 in shm TOC at 0x10be98040 > The fix for that problem seems to be: > /* Recreate error queues. */ > error_queue_space = > - shm_toc_lookup(pcxt->toc, PARALLEL_KEY_ERROR_QUEUE, false); > + shm_toc_lookup(pcxt->toc, PARALLEL_KEY_ERROR_QUEUE, true); > + Assert(pcxt->nworkers == 0 || error_queue_space != NULL); I happened across this patch while preparing the release notes, and I'm quite distressed by it, because it completely breaks the point of what I'd done in commit d46633506 (to wit, to not just blindly assume, nor just Assert, that shm_toc_lookup always succeeds). Do you mind if I change that Assert to a run-time test? regards, tom lane