mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-03-13 19:57:53 +08:00
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. Analysis and report by Marco Nenciarini Bug fix by Simon Riggs This is a correct backpatch of commit 66fbcb0d2e to branches 9.1 through 9.4. That commit was backpatched to 9.0 originally, but it was immediately reverted in 9.0-9.4 because it didn't compile.
This commit is contained in:
parent
463207630b
commit
6537a48c55
@ -6928,7 +6928,13 @@ heap_xlog_freeze(XLogRecPtr lsn, XLogRecord *record)
|
||||
* consider the frozen xids as running.
|
||||
*/
|
||||
if (InHotStandby)
|
||||
ResolveRecoveryConflictWithSnapshot(cutoff_xid, xlrec->node);
|
||||
{
|
||||
TransactionId latestRemovedXid = cutoff_xid;
|
||||
|
||||
TransactionIdRetreat(latestRemovedXid);
|
||||
|
||||
ResolveRecoveryConflictWithSnapshot(latestRemovedXid, xlrec->node);
|
||||
}
|
||||
|
||||
/* If we have a full-page image, restore it and we're done */
|
||||
if (record->xl_info & XLR_BKP_BLOCK(0))
|
||||
@ -7103,7 +7109,13 @@ heap_xlog_freeze_page(XLogRecPtr lsn, XLogRecord *record)
|
||||
* consider the frozen xids as running.
|
||||
*/
|
||||
if (InHotStandby)
|
||||
ResolveRecoveryConflictWithSnapshot(cutoff_xid, xlrec->node);
|
||||
{
|
||||
TransactionId latestRemovedXid = cutoff_xid;
|
||||
|
||||
TransactionIdRetreat(latestRemovedXid);
|
||||
|
||||
ResolveRecoveryConflictWithSnapshot(latestRemovedXid, xlrec->node);
|
||||
}
|
||||
|
||||
/* If we have a full-page image, restore it and we're done */
|
||||
if (record->xl_info & XLR_BKP_BLOCK(0))
|
||||
|
Loading…
x
Reference in New Issue
Block a user