]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Avoid early reuse of btree pages, causing incorrect query results.
authorSimon Riggs <simon@2ndQuadrant.com>
Fri, 1 Jun 2012 11:59:54 +0000 (12:59 +0100)
committerSimon Riggs <simon@2ndQuadrant.com>
Fri, 1 Jun 2012 11:59:54 +0000 (12:59 +0100)
commit9ced0134a4b0e9bd76e978259edc3540c6669883
tree7463fe4ac045f0d6703a00db01ff633f292f6762
parent485e12fb090afbf4484108c68cc07764089399d1
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 and backpatched by Simon Riggs
src/backend/access/nbtree/README
src/backend/access/nbtree/nbtpage.c