Skip to content

Commit 9af67b6

Browse files
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
1 parent b6c4b58 commit 9af67b6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/backend/access/heap/heapam.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7517,7 +7517,13 @@ heap_xlog_freeze_page(XLogRecPtr lsn, XLogRecord *record)
75177517
* consider the frozen xids as running.
75187518
*/
75197519
if (InHotStandby)
7520-
ResolveRecoveryConflictWithSnapshot(cutoff_xid, xlrec->node);
7520+
{
7521+
TransactionId latestRemovedXid = cutoff_xid;
7522+
7523+
TransactionIdRetreat(latestRemovedXid);
7524+
7525+
ResolveRecoveryConflictWithSnapshot(latestRemovedXid, rnode);
7526+
}
75217527

75227528
/* If we have a full-page image, restore it and we're done */
75237529
if (record->xl_info & XLR_BKP_BLOCK(0))

0 commit comments

Comments
 (0)