pgsql: Fix error when trying to delete page with half-dead left sibling

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix error when trying to delete page with half-dead left sibling
Date: 2014-05-25 22:18:48
Message-ID: E1Wogki-0000fA-IP@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix error when trying to delete page with half-dead left sibling.

The new page deletion code didn't cope with the case the target page's
right sibling was marked half-dead. It failed a sanity check which checked
that the downlinks in the parent page match the lower level, because a
half-dead page has no downlink. To cope, check for that condition, and
just give up on the deletion if it happens. The vacuum will finish the
deletion of the half-dead page when it gets there, and on the next vacuum
after that the empty can be deleted.

Reported by Jeff Janes.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/8da31837803e95f26642019d859c3309d1c125fa

Modified Files
--------------
src/backend/access/nbtree/nbtpage.c | 65 ++++++++++++++++++++++++++++++++---
1 file changed, 61 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2014-05-26 03:22:00 pgsql: Small typo and formatting fixes in postgresql.conf.sample
Previous Message Tom Lane 2014-05-25 20:34:22 pgsql: Allow total number of transactions in pgbench to exceed INT_MAX.