]> granicus.if.org Git - postgresql/commit
Avoid early reuse of btree pages, causing incorrect query results.
authorSimon Riggs <simon@2ndQuadrant.com>
Fri, 1 Jun 2012 11:21:45 +0000 (12:21 +0100)
committerSimon Riggs <simon@2ndQuadrant.com>
Fri, 1 Jun 2012 11:21:45 +0000 (12:21 +0100)
commitd3abbbebe52eb1e59e621c880ad57df9d40d13f2
tree698b33308213131ca92f62737de74f5a1d61da46
parent3e4d3a32b2f5c225a42f6fd4b09a7db64eea0a9b
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
src/backend/access/nbtree/README
src/backend/access/nbtree/nbtpage.c
src/backend/access/nbtree/nbtxlog.c