Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rRx49-00AONA-0Q for pgsql-bugs@arkaria.postgresql.org; Mon, 22 Jan 2024 16:22:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rRx47-004zYe-UM for pgsql-bugs@arkaria.postgresql.org; Mon, 22 Jan 2024 16:22:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with utf8esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rRx47-004zYV-9k for pgsql-bugs@lists.postgresql.org; Mon, 22 Jan 2024 16:22:27 +0000 Received: from out203-205-221-210.mail.qq.com ([203.205.221.210]) by makus.postgresql.org with utf8esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rRx41-002ofs-Ax for pgsql-bugs@lists.postgresql.org; Mon, 22 Jan 2024 16:22:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1705940530; bh=VN68zQadfUNwIPir0jIB6iga+HX5GZJ6+x5ITBnTVBU=; h=From:Subject:Date:In-Reply-To:Cc:To:References; b=VsQ0ogxZPss/2BAVfJth23aFFUpIevek9GrDqBBlT/ePAJ9+R5hcp+shA73gTaesQ +tNVRS6La20FHuIqC/aQpjVXiZCOgpPc6H0PQEeLISKN0k+Tvr2/PXOcUnV26Pbb9Y 4Kb5rmoqA8Qw0hJGtSPAMXy/fiUriZiD30Y/StEI= Received: from smtpclient.apple ([220.184.205.247]) by newxmesmtplogicsvrszb9-0.qq.com (NewEsmtp) with SMTP id 5888BE08; Tue, 23 Jan 2024 00:22:08 +0800 X-QQ-mid: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XMRINFO: OD9hHCdaPRBwq3WW+NvGbIU= From: feichanghong X-OQ-MSGID: <52CD3A6B-0C0E-4548-94B9-7550FD08A5D1@qq.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_3296FF63-9FC9-47AF-87A0-5AF4EA10376E" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.100.2.1.4\)) Subject: Re: MarkBufferDirty Assert held LW_EXCLUSIVE lock fail when ginFinishSplit Date: Tue, 23 Jan 2024 00:21:58 +0800 In-Reply-To: Cc: Michael Paquier , pgsql-bugs To: Heikki Linnakangas References: <053bc845-3cb5-445e-8ea4-00f6c678ee25@iki.fi> X-Mailer: Apple Mail (2.3774.100.2.1.4) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_3296FF63-9FC9-47AF-87A0-5AF4EA10376E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > =46rom 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.=E2=80=9D= Best Regards, Fei Changhong Alibaba Cloud Computing Ltd. --Apple-Mail=_3296FF63-9FC9-47AF-87A0-5AF4EA10376E Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
=46rom 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.=E2=80=9D


Best Regards,
Fei = Changhong
Alibaba Cloud Computing Ltd.

= --Apple-Mail=_3296FF63-9FC9-47AF-87A0-5AF4EA10376E--