Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 892a0e4

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 d66b67f commit 892a0e4

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
@@ -7064,7 +7064,13 @@ heap_xlog_freeze_page(XLogRecPtr lsn, XLogRecord *record)
70647064
* consider the frozen xids as running.
70657065
*/
70667066
if (InHotStandby)
7067-
ResolveRecoveryConflictWithSnapshot(cutoff_xid, xlrec->node);
7067+
{
7068+
TransactionId latestRemovedXid = cutoff_xid;
7069+
7070+
TransactionIdRetreat(latestRemovedXid);
7071+
7072+
ResolveRecoveryConflictWithSnapshot(latestRemovedXid, rnode);
7073+
}
70687074

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

0 commit comments

Comments
 (0)