From: Bossart, Nathan <bossartn@amazon.com>
To: Michael Paquier <michael@paquier.xyz>
To: Andres Freund <andres@anarazel.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: sulamul@gmail.com <sulamul@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: inefficient loop in StandbyReleaseLockList()
Date: Fri, 29 Oct 2021 17:30:44 +0000
Message-ID: <0108A03D-FF2B-4CBC-933B-E047CD975158@amazon.com> (raw)
In-Reply-To: <YXuaLlYJxkmwnTDl@paquier.xyz>
References: <CD2F0E7F-9822-45EC-A411-AE56F14DEA9F@amazon.com>
<CAAJ_b94_awY-VfbLbzxm4zNni3NXxG3wrSkSgnHyCDqHnT+eJg@mail.gmail.com>
<20211028.155751.1898631306946946681.horikyota.ntt@gmail.com>
<20211028220748.6ekrl74minwq75f4@alap3.anarazel.de>
<20211028221424.6wtcse3qkbf2cmqo@alap3.anarazel.de>
<560364.1635459891@sss.pgh.pa.us>
<B4C04240-1AAC-4200-9636-BCC7984688D8@amazon.com>
<565036.1635463448@sss.pgh.pa.us>
<20211028235248.4kbhtcqn2hvjukbd@alap3.anarazel.de>
<YXuaLlYJxkmwnTDl@paquier.xyz>
On 10/28/21, 11:53 PM, "Michael Paquier" <michael@paquier.xyz> wrote:
> On Thu, Oct 28, 2021 at 04:52:48PM -0700, Andres Freund wrote:
>> I suspect the reverse lock order release could be tad faster. But I probably
>> wouldn't change it either - I was more thinking of some of the other cases
>> that deleted the first element, here it's a bit harder to know wether there's
>> a chance of a CFI() or such.
>
> Actually, as the list of recovery locks is saved in TopMemoryContext,
> wouldn't it be better to keep a per-cell deletion of the list, which
> would mean that we'd better do the operation in the reverse order to
> make things faster with the new list implementation? But that's what
> Andres points at with CFIs in the middle of one list of the hash table
> processed?
Hm. IIUC anything bad enough to cause the startup process to break
out of the StandbyReleaseLockList() loop will also cause the entire
process to be restarted. I'm not seeing any risk of reusing a half-
released lock list. I might be misunderstanding the concern, though.
Nathan
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: bossartn@amazon.com, michael@paquier.xyz, andres@anarazel.de, tgl@sss.pgh.pa.us, horikyota.ntt@gmail.com, sulamul@gmail.com
Subject: Re: inefficient loop in StandbyReleaseLockList()
In-Reply-To: <0108A03D-FF2B-4CBC-933B-E047CD975158@amazon.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