pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Geoghegan <pg@bowt.ie>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Adjust "root of to-be-deleted subtree" function.
Date: Mon, 11 May 2020 18:02:57 +0000
Message-ID: <E1jYClV-0002T2-TJ@gemulon.postgresql.org> (raw)

Adjust "root of to-be-deleted subtree" function.

Restructure the function that locates the root of the to-be-deleted
subtree during nbtree page deletion.  Handle the conditions that make
page deletion unsafe in a slightly more uniform way, and acknowledge the
fact that the behavior with incomplete splits on internal pages is
different (as pointed out in the nbtree README as of commit 35bc0ec7).
Also invent new terminology that avoids ambiguity around which pages are
about to be deleted.  Consistently use the term "to-be-deleted subtree",
not the ambiguous term "branch".

We were calling the subtree parent page the "top parent page", but that
was quite misleading.  The top parent page usually refers to a page
unlinked from its siblings and marked deleted (during the second stage
of page deletion).  There was one kind of top parent page that we merely
removed a downlink from, and another kind of top parent page that we
actually marked deleted.  Eliminate the ambiguity by inventing a new
term ("subtree parent page") that refers to the former kind of page
only.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/624686abcf87d26fe7c03543c4a54aad2237cb93

Modified Files
--------------
src/backend/access/nbtree/README      |  14 +-
src/backend/access/nbtree/nbtinsert.c |   3 +-
src/backend/access/nbtree/nbtpage.c   | 462 +++++++++++++++++++---------------
src/backend/access/nbtree/nbtxlog.c   |   8 +-
src/include/access/nbtxlog.h          |   6 +-
5 files changed, 278 insertions(+), 215 deletions(-)



Message-ID: <E1jYClV-0002T2-TJ@gemulon.postgresql.org>
Permalink:  ../E1jYClV-0002T2-TJ@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jYClV-0002T2-TJ@gemulon.postgresql.org

 · 

reply

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: Adjust "root of to-be-deleted subtree" function.
  In-Reply-To: <E1jYClV-0002T2-TJ@gemulon.postgresql.org>
  References: <E1jYClV-0002T2-TJ@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