pgsql: Avoid early reuse of btree pages, causing incorrect query result

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Avoid early reuse of btree pages, causing incorrect query result
Date: 2012-06-01 11:38:12
Message-ID: E1SaQBI-0006xA-VD@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid early reuse of btree pages, causing incorrect query results.
When we allowed read-only transactions to skip assigning XIDs
we introduced the possibility that a fully deleted btree page
could be reused. This broke the index link sequence which could
then lead to indexscans silently returning fewer rows than would
have been correct. The actual incidence of silent errors from
this is thought to be very low because of the exact workload
required and locking pre-conditions. Fix is to remove pages only
if index page opaque->btpo.xact precedes RecentGlobalXmin.

Noah Misch, reviewed by Simon Riggs

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/d3abbbebe52eb1e59e621c880ad57df9d40d13f2

Modified Files
--------------
src/backend/access/nbtree/README | 8 +++++---
src/backend/access/nbtree/nbtpage.c | 32 ++++++++++----------------------
src/backend/access/nbtree/nbtxlog.c | 6 +++++-
3 files changed, 20 insertions(+), 26 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Simon Riggs 2012-06-01 11:39:30 pgsql: Avoid early reuse of btree pages, causing incorrect query result
Previous Message Simon Riggs 2012-06-01 10:50:25 pgsql: Improve description of pg_stat_statements normalisation in relea