pgsql: Adjust "root of to-be-deleted subtree" function. - Mailing list pgsql-committers

From Peter Geoghegan
Subject pgsql: Adjust "root of to-be-deleted subtree" function.
Date
Msg-id E1jYClV-0002T2-TJ@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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(-)


pgsql-committers by date:

Previous
From: Alvaro Herrera
Date:
Subject: pgsql: Fix obsolete references to "XLogRead"
Next
From: Tom Lane
Date:
Subject: pgsql: Doc: fix "Unresolved ID reference" warnings, clean up man page c