Skip to content

Commit b544ea1

Browse files
Fix rare missing cancellations in Hot Standby.
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.
1 parent 3cef217 commit b544ea1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/access/heap/pruneheap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ heap_page_prune(Relation relation, Buffer buffer, TransactionId OldestXmin,
171171
* initialize the rest of our working state.
172172
*/
173173
prstate.new_prune_xid = InvalidTransactionId;
174-
prstate.latestRemovedXid = InvalidTransactionId;
174+
prstate.latestRemovedXid = *latestRemovedXid;
175175
prstate.nredirected = prstate.ndead = prstate.nunused = 0;
176176
memset(prstate.marked, 0, sizeof(prstate.marked));
177177

0 commit comments

Comments
 (0)