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 1kwiQ6-0003LS-MO for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Jan 2021 09:14:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kwiQ5-0005e7-C8 for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Jan 2021 09:14:25 +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 1kwiQ5-0005dz-2S for pgsql-hackers@lists.postgresql.org; Tue, 05 Jan 2021 09:14:25 +0000 Received: from smtp-fw-9102.amazon.com ([207.171.184.29]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kwiPx-0005hN-PY for pgsql-hackers@postgresql.org; Tue, 05 Jan 2021 09:14:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1609838057; x=1641374057; h=to:cc:references:from:message-id:date:mime-version: in-reply-to:content-transfer-encoding:subject; bh=GLJHWRmHN9DkgerxCY14E0JTMGzjsqD+4yHglOtWTGk=; b=BRFdK6bqkF8R6kodJikqxZttdMcxgTRH2NkqHWXgnd1+/bKEYeiOLWua ++UiFhQlNiSysXzNbSs/un51sXGOihTN3x2v5KbcmzqJZqeC009UZZCRb L80O5vNytPU4TZJqKnqtgN2LyMsPonbFEsqPPazD6b+1g4i/aHJjXsIrr M=; X-IronPort-AV: E=Sophos;i="5.78,476,1599523200"; d="scan'208";a="109560708" Subject: Re: Deadlock between backend and recovery may not be detected Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1d-38ae4ad2.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP; 05 Jan 2021 09:14:08 +0000 Received: from EX13D03EUC003.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-1d-38ae4ad2.us-east-1.amazon.com (Postfix) with ESMTPS id 5E7FCA2376; Tue, 5 Jan 2021 09:14:06 +0000 (UTC) Received: from 38f9d36c4abb.ant.amazon.com (10.43.161.8) by EX13D03EUC003.ant.amazon.com (10.43.164.192) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 5 Jan 2021 09:14:02 +0000 To: Fujii Masao , Kyotaro Horiguchi CC: , , References: <20201225.131611.1914966836446852743.horikyota.ntt@gmail.com> <030f0625-481a-2e26-6d09-c860b0f075b1@oss.nttdata.com> From: "Drouvot, Bertrand" Message-ID: <8a96c07b-a951-6507-bb84-3e50daaf1306@amazon.com> Date: Tue, 5 Jan 2021 10:13:58 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <030f0625-481a-2e26-6d09-c860b0f075b1@oss.nttdata.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [10.43.161.8] X-ClientProxiedBy: EX13D42UWA003.ant.amazon.com (10.43.160.101) To EX13D03EUC003.ant.amazon.com (10.43.164.192) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 1/5/21 7:26 AM, Fujii Masao wrote: > CAUTION: This email originated from outside of the organization. Do > not click links or open attachments unless you can confirm the sender > and know the content is safe. > > > > 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? Reading your arguments, I am inclined to think the same. Bertrand