pgsql: Fix WAL-logging of B-tree "unlink halfdead page" operation.

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix WAL-logging of B-tree "unlink halfdead page" operation.
Date: 2014-11-17 16:49:17
Message-ID: E1XqPUL-0006QH-JA@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix WAL-logging of B-tree "unlink halfdead page" operation.

There was some confusion on how to record the case that the operation
unlinks the last non-leaf page in the branch being deleted.
_bt_unlink_halfdead_page set the "topdead" field in the WAL record to
the leaf page, but the redo routine assumed that it would be an invalid
block number in that case. This commit fixes _bt_unlink_halfdead_page to
do what the redo routine expected.

This code is new in 9.4, so backpatch there.

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/8607fdf0337051ca1da493ded5db15c41da08d66

Modified Files
--------------
src/backend/access/nbtree/nbtpage.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2014-11-17 17:09:30 pgsql: Update time zone data files to tzdata release 2014j.
Previous Message Alvaro Herrera 2014-11-17 14:24:29 pgsql: Fix relpersistence setting in reindex_index