Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit87f830e

Browse files
committed
Adjust cutoff points in newly-added sanity tests.
Per recommendation from Andres.
1 parent78db307 commit87f830e

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

‎src/backend/commands/vacuum.c

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -745,13 +745,13 @@ vac_update_relstats(Relation relation,
745745
* which case we don't want to forget the work it already did. However,
746746
* if the stored relfrozenxid is "in the future", then it must be corrupt
747747
* and it seems best to overwrite it with the cutoff we used this time.
748-
*Seevac_update_datfrozenxid() concerning what we consider to be "in the
749-
* future".
748+
*This should matchvac_update_datfrozenxid() concerning what we consider
749+
*to be "in thefuture".
750750
*/
751751
if (TransactionIdIsNormal(frozenxid)&&
752752
pgcform->relfrozenxid!=frozenxid&&
753753
(TransactionIdPrecedes(pgcform->relfrozenxid,frozenxid)||
754-
TransactionIdPrecedes(GetOldestXmin(NULL, true),
754+
TransactionIdPrecedes(ReadNewTransactionId(),
755755
pgcform->relfrozenxid)))
756756
{
757757
pgcform->relfrozenxid=frozenxid;
@@ -762,7 +762,7 @@ vac_update_relstats(Relation relation,
762762
if (MultiXactIdIsValid(minmulti)&&
763763
pgcform->relminmxid!=minmulti&&
764764
(MultiXactIdPrecedes(pgcform->relminmxid,minmulti)||
765-
MultiXactIdPrecedes(GetOldestMultiXactId(),pgcform->relminmxid)))
765+
MultiXactIdPrecedes(ReadNextMultiXactId(),pgcform->relminmxid)))
766766
{
767767
pgcform->relminmxid=minmulti;
768768
dirty= true;
@@ -803,8 +803,8 @@ vac_update_datfrozenxid(void)
803803
SysScanDescscan;
804804
HeapTupleclassTup;
805805
TransactionIdnewFrozenXid;
806-
TransactionIdlastSaneFrozenXid;
807806
MultiXactIdnewMinMulti;
807+
TransactionIdlastSaneFrozenXid;
808808
MultiXactIdlastSaneMinMulti;
809809
boolbogus= false;
810810
booldirty= false;
@@ -815,13 +815,21 @@ vac_update_datfrozenxid(void)
815815
* committed pg_class entries for new tables; see AddNewRelationTuple().
816816
* So we cannot produce a wrong minimum by starting with this.
817817
*/
818-
newFrozenXid=lastSaneFrozenXid=GetOldestXmin(NULL, true);
818+
newFrozenXid=GetOldestXmin(NULL, true);
819819

820820
/*
821821
* Similarly, initialize the MultiXact "min" with the value that would be
822822
* used on pg_class for new tables. See AddNewRelationTuple().
823823
*/
824-
newMinMulti=lastSaneMinMulti=GetOldestMultiXactId();
824+
newMinMulti=GetOldestMultiXactId();
825+
826+
/*
827+
* Identify the latest relfrozenxid and relminmxid values that we could
828+
* validly see during the scan. These are conservative values, but it's
829+
* not really worth trying to be more exact.
830+
*/
831+
lastSaneFrozenXid=ReadNewTransactionId();
832+
lastSaneMinMulti=ReadNextMultiXactId();
825833

826834
/*
827835
* We must seqscan pg_class to find the minimum Xid, because there is no

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp