From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: Drouvot, Bertrand <bdrouvot@amazon.com>
Cc: Victor Yegorov <vyegorov@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Deadlock between backend and recovery may not be detected
Date: Wed, 6 Jan 2021 12:55:13 +0900
Message-ID: <eb6d1c28-bd69-2286-fe0a-22dcd2744d83@oss.nttdata.com> (raw)
In-Reply-To: <CAD21AoBWTc_hF9-JcMZqxBi=Du1JCK1sZvdiWViYrvS9SHrmHg@mail.gmail.com>
References: <b2745637-2333-4b8e-7aaf-5b880ac5224f@oss.nttdata.com>
<CAD21AoCXR107rCsZ987oFGnkfn1KJYLz__68sGhDP==3d2mU3Q@mail.gmail.com>
<c414ad2e-ef75-1b60-3611-e8fe367e136d@oss.nttdata.com>
<20201225.131611.1914966836446852743.horikyota.ntt@gmail.com>
<030f0625-481a-2e26-6d09-c860b0f075b1@oss.nttdata.com>
<CAD21AoBWTc_hF9-JcMZqxBi=Du1JCK1sZvdiWViYrvS9SHrmHg@mail.gmail.com>
On 2021/01/06 11:48, Masahiko Sawada wrote:
> On Tue, Jan 5, 2021 at 3:26 PM Fujii Masao <masao.fujii@oss.nttdata.com> wrote:
>>
>>
>>
>> On 2020/12/25 13:16, Kyotaro Horiguchi wrote:
>>> At Wed, 23 Dec 2020 21:42:47 +0900, Fujii Masao <masao.fujii@oss.nttdata.com> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: masao.fujii@oss.nttdata.com, sawada.mshk@gmail.com, horikyota.ntt@gmail.com, bdrouvot@amazon.com, vyegorov@gmail.com
Subject: Re: Deadlock between backend and recovery may not be detected
In-Reply-To: <eb6d1c28-bd69-2286-fe0a-22dcd2744d83@oss.nttdata.com>
References: <b2745637-2333-4b8e-7aaf-5b880ac5224f@oss.nttdata.com> <CAD21AoCXR107rCsZ987oFGnkfn1KJYLz__68sGhDP==3d2mU3Q@mail.gmail.com> <c414ad2e-ef75-1b60-3611-e8fe367e136d@oss.nttdata.com> <20201225.131611.1914966836446852743.horikyota.ntt@gmail.com> <030f0625-481a-2e26-6d09-c860b0f075b1@oss.nttdata.com> <CAD21AoBWTc_hF9-JcMZqxBi=Du1JCK1sZvdiWViYrvS9SHrmHg@mail.gmail.com> <eb6d1c28-bd69-2286-fe0a-22dcd2744d83@oss.nttdata.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox