Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k3h6e-0008Mp-VC for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Aug 2020 14:42:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k3h67-0006GL-79 for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Aug 2020 14:42:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k3h67-0006GD-02 for pgsql-hackers@lists.postgresql.org; Thu, 06 Aug 2020 14:42:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k3h5z-0002YA-DK for pgsql-hackers@postgresql.org; Thu, 06 Aug 2020 14:42:21 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 076EgA7j2626505; Thu, 6 Aug 2020 10:42:10 -0400 From: Tom Lane To: Andy Fan cc: Robert Haas , Amit Langote , Justin Pryzby , "pgsql-hackers@postgresql.org" Subject: Re: FailedAssertion("pd_idx == pinfo->nparts", File: "execPartition.c", Line: 1689) In-reply-to: References: <20200802181131.GA27754@telsasoft.com> <20200803161133.GA21372@telsasoft.com> <2528807.1596648630@sss.pgh.pa.us> <2550497.1596651719@sss.pgh.pa.us> <2598266.1596686548@sss.pgh.pa.us> Comments: In-reply-to Andy Fan message dated "Thu, 06 Aug 2020 21:52:23 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2626503.1596724930.1@sss.pgh.pa.us> Date: Thu, 06 Aug 2020 10:42:10 -0400 Message-ID: <2626504.1596724930@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andy Fan writes: > On Thu, Aug 6, 2020 at 12:02 PM Tom Lane wrote: >> See my straw-man proposal downthread. > Thanks for your explanation, I checked it again and it looks a very clean > method. The attached is a draft patch based on my understanding. Hope > I didn't misunderstand you.. Ah, I was going to play arond with that today, but you beat me to it ;-) A few thoughts after a quick look at the patch: * I had envisioned that there's a custom GUC controlling the lock ID used; this would allow blocking different sessions at different points, if we ever need that. Also, I'd make the GUC start out as zero which means "do nothing", so that merely loading the module has no immediate effect. * Don't really see the point of the before-planning lock. * Rather than exposing internal declarations from lockfuncs.c, you could just write calls to pg_advisory_lock_int8 etc. using DirectFunctionCall1. * We need some better name than "test_module". I had vaguely thought about "delay_execution", but am surely open to better ideas. regards, tom lane