From: Peter Geoghegan <pg@bowt.ie>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Refactor nbtree deletion INCOMPLETE_SPLIT check.
Date: Thu, 07 May 2020 23:09:15 +0000
Message-ID: <E1jWpdj-0002OH-B3@gemulon.postgresql.org> (raw)
Refactor nbtree deletion INCOMPLETE_SPLIT check.
Factor out code common to _bt_lock_branch_parent() and _bt_pagedel()
into a new utility function. This new function is used to check that
the left sibling of a deletion target page does not have the
INCOMPLETE_SPLIT page flag set. If it is set then deletion is unsafe;
there won't be a usable pivot tuple (with a downlink) in the parent page
that points to the deletion target page. The page deletion algorithm is
not prepared to deal with that. Also restructure an existing, related
utility function that checks if the right sibling of the target page has
the ISHALFDEAD page flag set.
This organization highlights the symmetry between the two cases. The
goal is to make the design of page deletion clearer. Both functions
involve a sibling page with a flag that indicates that there was an
interrupted operation (a page split or a page deletion) that resulted in
a page pointed to by sibling pages, but not pointed to in the parent.
And, both functions indicate if page deletion is unsafe due to the
absence of a particular downlink in the parent page.
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/cd8c73a38a23c364e71973d6832a585616d24756
Modified Files
--------------
src/backend/access/nbtree/nbtpage.c | 184 ++++++++++++++++++++----------------
1 file changed, 100 insertions(+), 84 deletions(-)
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-committers@postgresql.org
Cc: pg@bowt.ie
Subject: Re: pgsql: Refactor nbtree deletion INCOMPLETE_SPLIT check.
In-Reply-To: <E1jWpdj-0002OH-B3@gemulon.postgresql.org>
References: <E1jWpdj-0002OH-B3@gemulon.postgresql.org>
* 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