pgsql: Cleanup of new b-tree page deletion code.

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Cleanup of new b-tree page deletion code.
Date: 2014-04-23 09:55:22
Message-ID: E1Wctti-00008I-Gq@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Cleanup of new b-tree page deletion code.

When marking a branch as half-dead, a pointer to the top of the branch is
stored in the leaf block's hi-key. During normal operation, the high key
was left in place, and the block number was just stored in the ctid field
of the high key tuple, but in WAL replay, the high key was recreated as a
truncated tuple with zero columns. For the sake of easier debugging, also
truncate the tuple in normal operation, so that the page is identical
after WAL replay. Also, rename the 'downlink' field in the WAL record to
'topparent', as that seems like a more descriptive name. And make sure
it's set to invalid when unlinking the leaf page.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/4fafc4ecd9e4d224d92c4a8549c5646860787a5d

Modified Files
--------------
src/backend/access/nbtree/nbtpage.c | 27 ++++++++++++++++++++-------
src/backend/access/nbtree/nbtxlog.c | 8 ++++----
src/backend/access/rmgrdesc/nbtdesc.c | 8 ++++----
src/include/access/nbtree.h | 8 +++++---
4 files changed, 33 insertions(+), 18 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-04-23 09:59:39 pgsql: Fix typos in comment.
Previous Message Tom Lane 2014-04-23 03:22:22 pgsql: Fix documentation of FmgrInfo.fn_nargs.