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 1kwzuq-0004k5-N8 for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Jan 2021 03:55:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kwzup-0006UR-JO for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Jan 2021 03:55:19 +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 1kwzup-0006UK-Cc for pgsql-hackers@lists.postgresql.org; Wed, 06 Jan 2021 03:55:19 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kwzun-0003VQ-6e for pgsql-hackers@postgresql.org; Wed, 06 Jan 2021 03:55:18 +0000 Received: from hnk.local (p2390043-ipbf1028funabasi.chiba.ocn.ne.jp [118.7.248.43]) by oss.nttdata.com (Postfix) with ESMTPSA id EC215600FA; Wed, 6 Jan 2021 12:55:13 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at oss.nttdata.com Subject: Re: Deadlock between backend and recovery may not be detected To: Masahiko Sawada Cc: Kyotaro Horiguchi , "Drouvot, Bertrand" , Victor Yegorov , PostgreSQL-development References: <20201225.131611.1914966836446852743.horikyota.ntt@gmail.com> <030f0625-481a-2e26-6d09-c860b0f075b1@oss.nttdata.com> From: Fujii Masao Message-ID: Date: Wed, 6 Jan 2021 12:55:13 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2021/01/06 11:48, Masahiko Sawada wrote: > On Tue, Jan 5, 2021 at 3:26 PM Fujii Masao wrote: >> >> >> >> On 2020/12/25 13:16, Kyotaro Horiguchi wrote: >>> At Wed, 23 Dec 2020 21:42:47 +0900, Fujii Masao wrote in >>>> you. Attached >>>> is the updated of the patch. What about this version? >>> >>> The patch contains a hunk in the following structure. >>> >>> + if (got_standby_lock_timeout) >>> + goto cleanup; >>> + >>> + if (got_standby_deadlock_timeout) >>> + { >>> ... >>> + } >>> + >>> +cleanup: >>> >>> It is eqivalent to >>> >>> + if (!got_standby_lock_timeout && got_standby_deadlock_timeout) >>> + { >>> ... >>> + } >>> >>> Is there any reason for the goto? >> >> Yes. That's because we have the following code using goto. >> >> + /* Quick exit if there's no work to be done */ >> + if (!VirtualTransactionIdIsValid(*backends)) >> + goto cleanup; >> >> >> Regarding the back-patch, I was thinking to back-patch this to all the >> supported branches. But I found that it's not easy to do that to v9.5 >> because v9.5 doesn't have some infrastructure code that this bug fix >> patch depends on. So at least the commit 37c54863cf as the infrastructure >> also needs to be back-patched to v9.5. And ISTM that some related commits >> f868a8143a and 8f0de712c3 need to be back-patched. Probably there might >> be some other changes to be back-patched. Unfortunately they cannot be >> applied to v9.5 cleanly and additional changes are necessary. >> >> This situation makes me feel that I'm inclined to skip the back-patch to v9.5. >> Because the next minor version release is the final one for v9.5. So if we >> unexpectedly introduce the bug to v9.5 by the back-patch, there is no >> chance to fix that. OTOH, of course, if we don't do the back-patch, there is >> no chance to fix the deadlock detection bug since the final minor version >> for v9.5 doesn't include that bug fix. But I'm afraid that the back-patch >> to v9.5 may give more risk than gain. >> >> Thought? > > +1 for not-backpatching to 9.5. Thanks all! I pushed the patch and back-patched to v9.6. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION