]> granicus.if.org Git - postgresql/commitdiff
Fix rare missing cancellations in Hot Standby.
authorSimon Riggs <simon@2ndQuadrant.com>
Thu, 24 Jan 2013 14:24:17 +0000 (14:24 +0000)
committerSimon Riggs <simon@2ndQuadrant.com>
Thu, 24 Jan 2013 14:24:17 +0000 (14:24 +0000)
The machinery around XLOG_HEAP2_CLEANUP_INFO failed
to correctly pass through the necessary information
on latestRemovedXid, avoiding cancellations in some
infrequent concurrent update/cleanup scenarios.

Backpatchable fix to 9.0

Detailed bug report and fix by Noah Misch,
backpatchable version by me.

src/backend/access/heap/pruneheap.c

index b61b603adb1eac2fbbf42443a5762ed5ac2274c4..e05d9d3f229c3419f0877682345d592e32f052ec 100644 (file)
@@ -171,7 +171,7 @@ heap_page_prune(Relation relation, Buffer buffer, TransactionId OldestXmin,
         * initialize the rest of our working state.
         */
        prstate.new_prune_xid = InvalidTransactionId;
-       prstate.latestRemovedXid = InvalidTransactionId;
+       prstate.latestRemovedXid = *latestRemovedXid;
        prstate.nredirected = prstate.ndead = prstate.nunused = 0;
        memset(prstate.marked, 0, sizeof(prstate.marked));