Re: MarkBufferDirty Assert held LW_EXCLUSIVE lock fail when ginFinishSplit

feichanghong <feichanghong@qq.com>

From: feichanghong <feichanghong@qq.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Michael Paquier <michael@paquier.xyz>, pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Date: 2024-01-22T16:21:58Z
Lists: pgsql-bugs

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix locking when fixing an incomplete split of a GIN internal page

  2. Add backend support for injection points

> 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.