]> granicus.if.org Git - postgresql/commit
Improve underdocumented btree_xlog_delete_get_latestRemovedXid() code.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 3 Aug 2012 19:41:18 +0000 (15:41 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 3 Aug 2012 19:41:18 +0000 (15:41 -0400)
commitf786e91a75b2f64527dcf321e754b6448fcad7fe
tree0e8e8505f9bb74015174bf83e48eaef3ee003d66
parentc1793f2e0ce4ee5c713f27d0bdacc7d99b9103ac
Improve underdocumented btree_xlog_delete_get_latestRemovedXid() code.

As noted by Noah Misch, btree_xlog_delete_get_latestRemovedXid is
critically dependent on the assumption that it's examining a consistent
state of the database.  This was undocumented though, so the
seemingly-unrelated check for no active HS sessions might be thought to be
merely an optional optimization.  Improve comments, and add an explicit
check of reachedConsistency just to be sure.

This function returns InvalidTransactionId (thereby killing all HS
transactions) in several cases that are not nearly unlikely enough for my
taste.  This commit doesn't attempt to fix those deficiencies, just
document them.

Back-patch to 9.2, not from any real functional need but just to keep the
branches more closely synced to simplify possible future back-patching.
src/backend/access/nbtree/nbtxlog.c