Commit 66fbcb0d authored by Simon Riggs's avatar Simon Riggs

Avoid hot standby cancels from VAC FREEZE

VACUUM FREEZE generated false cancelations of standby queries on an
otherwise idle master. Caused by an off-by-one error on cutoff_xid
which goes back to original commit.

Backpatch to all versions 9.0+

Analysis and report by Marco Nenciarini

Bug fix by Simon Riggs
parent 7d60b2af
...@@ -7572,9 +7572,12 @@ heap_xlog_freeze_page(XLogReaderState *record) ...@@ -7572,9 +7572,12 @@ heap_xlog_freeze_page(XLogReaderState *record)
if (InHotStandby) if (InHotStandby)
{ {
RelFileNode rnode; RelFileNode rnode;
TransactionId latestRemovedXid = cutoff_xid;
TransactionIdRetreat(latestRemovedXid);
XLogRecGetBlockTag(record, 0, &rnode, NULL, NULL); XLogRecGetBlockTag(record, 0, &rnode, NULL, NULL);
ResolveRecoveryConflictWithSnapshot(cutoff_xid, rnode); ResolveRecoveryConflictWithSnapshot(latestRemovedXid, rnode);
} }
if (XLogReadBufferForRedo(record, 0, &buffer) == BLK_NEEDS_REDO) if (XLogReadBufferForRedo(record, 0, &buffer) == BLK_NEEDS_REDO)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment