From: feichanghong <feichanghong@qq.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Subject: Re: MarkBufferDirty Assert held LW_EXCLUSIVE lock fail when ginFinishSplit
Date: Tue, 23 Jan 2024 00:21:58 +0800
Message-ID: <tencent_BEFB72867BA7CF879B492487284296D2F606@qq.com> (raw)
In-Reply-To: <d8f0b068-0e6e-4b2c-8932-62507eb7e1c6@iki.fi>
References: <tencent_A3CE810F59132D8E230475A5F0F7A08C8307@qq.com>
<053bc845-3cb5-445e-8ea4-00f6c678ee25@iki.fi>
<tencent_0F9D2F03B4F3E2C3DE4483E31B4147C9F605@qq.com>
<d8f0b068-0e6e-4b2c-8932-62507eb7e1c6@iki.fi>
> From a performance point of view, this doesn't matter. Incomplete split are extremely rare. For convenience, though, I added a new function specifically for handling these "leftover" incomplete splits as opposed to finishing a split that you just made, which performs the lock-upgrade. See attached. I think that helps with readability, and makes it less likely that we'll forget the lock-upgrade in the future if the insertion code is refactored.
I think that the lock-upgrade in the ginFinishOldSplit function is unsafe
because it violates the requirement of the ginStepRight function that
"The next page is locked first, before releasing the current page.”
Best Regards,
Fei Changhong
Alibaba Cloud Computing Ltd.
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-bugs@postgresql.org
Cc: feichanghong@qq.com, hlinnaka@iki.fi, michael@paquier.xyz
Subject: Re: MarkBufferDirty Assert held LW_EXCLUSIVE lock fail when ginFinishSplit
In-Reply-To: <tencent_BEFB72867BA7CF879B492487284296D2F606@qq.com>
References: <tencent_A3CE810F59132D8E230475A5F0F7A08C8307@qq.com> <053bc845-3cb5-445e-8ea4-00f6c678ee25@iki.fi> <tencent_0F9D2F03B4F3E2C3DE4483E31B4147C9F605@qq.com> <d8f0b068-0e6e-4b2c-8932-62507eb7e1c6@iki.fi> <tencent_BEFB72867BA7CF879B492487284296D2F606@qq.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