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 1m9s3g-0003Wo-7A for pgsql-committers@arkaria.postgresql.org; Sat, 31 Jul 2021 16:41: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 1m9s38-0007Ib-Tu for pgsql-committers@arkaria.postgresql.org; Sat, 31 Jul 2021 16:41:22 +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 1m9s38-0007IT-O8 for pgsql-committers@lists.postgresql.org; Sat, 31 Jul 2021 16:41:22 +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 1m9s36-0004Gc-92 for pgsql-committers@lists.postgresql.org; Sat, 31 Jul 2021 16:41:22 +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 16VGfGjp1255272; Sat, 31 Jul 2021 12:41:17 -0400 From: Tom Lane To: Etsuro Fujita cc: Michael Paquier , Etsuro Fujita , pgsql-committers Subject: Re: pgsql: postgres_fdw: Fix handling of pending asynchronous requests. In-reply-to: References: Comments: In-reply-to Etsuro Fujita message dated "Sat, 31 Jul 2021 23:16:14 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1255270.1627749676.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Sat, 31 Jul 2021 12:41:16 -0400 Message-ID: <1255271.1627749676@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Etsuro Fujita writes: > I couldn’t reproduce this in my environment, but I noticed this, which > didn’t happen in my environment: the case of delivering notifications > to both of the parent async-capable nodes in ExecAppendAsyncEventWait > when processing the added test case query. In that case, doing > postgresForeignAsyncNotify for the first parent async-capable node > would invoke process_pending_request on the second one when executing > its initplan, which would lead to the assertion failure when doing > postgresForeignAsyncNotify for the second one. :-( I think > postgresForeignAsyncNotify would need the same treatment as for > postgresForeignAsyncConfigureWait, like the attached. I tried this patch on a spare machine that seems prone to showing the failure: on HEAD, postgres_fdw's installcheck failed 3 times in 4 attempts. With the patch, it's gotten through 23 consecutive tries without a failure. So this is at least way better ... regards, tom lane