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 1njm5y-0001zy-44 for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Apr 2022 18:08:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1njm5w-0008Tv-00 for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Apr 2022 18:08:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1njm5v-0008TB-Ma for pgsql-hackers@lists.postgresql.org; Wed, 27 Apr 2022 18:08:55 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1njm5q-00059f-Iq for pgsql-hackers@lists.postgresql.org; Wed, 27 Apr 2022 18:08:54 +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 23RI8jWN447239; Wed, 27 Apr 2022 14:08:45 -0400 From: Tom Lane To: Andres Freund cc: Thomas Munro , Melanie Plageman , pgsql-hackers@lists.postgresql.org Subject: Re: Unstable tests for recovery conflict handling In-reply-to: <394950.1651077914@sss.pgh.pa.us> References: <394950.1651077914@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 27 Apr 2022 12:45:14 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <447237.1651082925.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 27 Apr 2022 14:08:45 -0400 Message-ID: <447238.1651082925@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > It's been kind of hidden by other buildfarm noise, but > 031_recovery_conflict.pl is not as stable as it should be [1][2][3][4]. > ... > I think this is showing us a real bug, ie we sometimes fail to cancel > the conflicting query. After digging around in the code, I think this is almost certainly some manifestation of the previously-complained-of problem [1] that RecoveryConflictInterrupt is not safe to call in a signal handler, leading the conflicting backend to sometimes decide that it's not the problem. That squares with the observation that skink is more prone to show this than other animals: you'd have to get the SIGUSR1 while the target backend isn't idle, so a very slow machine ought to show it more. We don't seem to have that issue on the open items list, but I'll go add it. Not sure if the 'buffer pin conflict: stats show conflict on standby' failure could trace to a similar cause. regards, tom lane [1] https://www.postgresql.org/message-id/flat/CA%2BhUKGK3PGKwcKqzoosamn36= YW-fsuTdOPPF1i_rtEO%3DnEYKSg%40mail.gmail.com