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 1lrsaG-0007bz-Kf for pgsql-bugs@arkaria.postgresql.org; Sat, 12 Jun 2021 01:37:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lrsaF-0003mq-3q for pgsql-bugs@arkaria.postgresql.org; Sat, 12 Jun 2021 01:37:11 +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 1lrsaE-0003ky-TF for pgsql-bugs@lists.postgresql.org; Sat, 12 Jun 2021 01:37:10 +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 1lrsaB-0004Jy-Nq for pgsql-bugs@lists.postgresql.org; Sat, 12 Jun 2021 01:37:10 +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 15C1b5YM2139836; Fri, 11 Jun 2021 21:37:05 -0400 From: Tom Lane To: Michael Paquier cc: Amit Langote , sbernikov@gmail.com, PostgreSQL mailing lists Subject: Re: BUG #17055: Logical replication worker crashes when applying update of row that dose not exist in target partiti In-reply-to: References: <1828113.1623370641@sss.pgh.pa.us> <1881335.1623423667@sss.pgh.pa.us> <2058966.1623442520@sss.pgh.pa.us> <2136546.1623457890@sss.pgh.pa.us> <2138662.1623460441@sss.pgh.pa.us> Comments: In-reply-to Michael Paquier message dated "Sat, 12 Jun 2021 10:31:35 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2139834.1623461825.1@sss.pgh.pa.us> Date: Fri, 11 Jun 2021 21:37:05 -0400 Message-ID: <2139835.1623461825@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Michael Paquier writes: > Still, the current style is not a pattern I think we should spread > around, as a lot of copy-paste gets done in new tests added and one > would easily mix up queries with pattern checks. The practice I'd > like to encourage is something like the attached, to make clear that > there is no risk to fetch incorrect logs. If you prefer. However, I'd note that this patch as it stands sort of breaks the argument I just made, as now you are interrogating the postmaster's state after sending SIGHUP and before doing anything that will wait for that to take effect. I think you should move the location-capture commands down by at least one safe_psql call. regards, tom lane