!98 fix could not open csnlog file when do vacuum

Merge pull request !98 from xiong_xjun/master
This commit is contained in:
opengauss-bot
2020-08-13 15:37:15 +08:00
committed by Gitee

View File

@ -4054,6 +4054,12 @@ void CalculateLocalLatestSnapshot(bool forceCalc)
volatile PGXACT* pgxact = &g_instance.proc_base_all_xacts[pgprocno];
TransactionId xid;
/* Update globalxmin to be the smallest valid xmin */
xid = pgxact->xmin; /* fetch just once */
if (TransactionIdIsNormal(xid) && TransactionIdPrecedes(xid, globalxmin))
globalxmin = xid;
/*
* Backend is doing logical decoding which manages xmin
* separately, check below.
@ -4065,12 +4071,6 @@ void CalculateLocalLatestSnapshot(bool forceCalc)
if (pgxact->vacuumFlags & PROC_IN_VACUUM)
continue;
/* Update globalxmin to be the smallest valid xmin */
xid = pgxact->xmin; /* fetch just once */
if (TransactionIdIsNormal(xid) && TransactionIdPrecedes(xid, globalxmin))
globalxmin = xid;
/* Fetch xid just once - see GetNewTransactionId */
xid = pgxact->xid;