aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2014-07-21 12:58:49 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2014-07-21 12:58:49 -0400
commit4ee95870de343cd027c7727a175fe1c27c75a389 (patch)
tree8b31fca3cce83d3193797b36974ab219d98a6bb0
parente7984cca069f2064f5b9d8dc2a5f841f63d56156 (diff)
downloadpostgresql-4ee95870de343cd027c7727a175fe1c27c75a389.tar.gz
postgresql-4ee95870de343cd027c7727a175fe1c27c75a389.zip
Adjust cutoff points in newly-added sanity tests.
Per recommendation from Andres.
-rw-r--r--src/backend/commands/vacuum.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index 47eef924be0..79f952c9096 100644
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -745,13 +745,13 @@ vac_update_relstats(Relation relation,
* which case we don't want to forget the work it already did. However,
* if the stored relfrozenxid is "in the future", then it must be corrupt
* and it seems best to overwrite it with the cutoff we used this time.
- * See vac_update_datfrozenxid() concerning what we consider to be "in the
- * future".
+ * This should match vac_update_datfrozenxid() concerning what we consider
+ * to be "in the future".
*/
if (TransactionIdIsNormal(frozenxid) &&
pgcform->relfrozenxid != frozenxid &&
(TransactionIdPrecedes(pgcform->relfrozenxid, frozenxid) ||
- TransactionIdPrecedes(GetOldestXmin(true, true),
+ TransactionIdPrecedes(ReadNewTransactionId(),
pgcform->relfrozenxid)))
{
pgcform->relfrozenxid = frozenxid;
@@ -762,7 +762,7 @@ vac_update_relstats(Relation relation,
if (MultiXactIdIsValid(minmulti) &&
pgcform->relminmxid != minmulti &&
(MultiXactIdPrecedes(pgcform->relminmxid, minmulti) ||
- MultiXactIdPrecedes(GetOldestMultiXactId(), pgcform->relminmxid)))
+ MultiXactIdPrecedes(ReadNextMultiXactId(), pgcform->relminmxid)))
{
pgcform->relminmxid = minmulti;
dirty = true;
@@ -803,8 +803,8 @@ vac_update_datfrozenxid(void)
SysScanDesc scan;
HeapTuple classTup;
TransactionId newFrozenXid;
- TransactionId lastSaneFrozenXid;
MultiXactId newMinMulti;
+ TransactionId lastSaneFrozenXid;
MultiXactId lastSaneMinMulti;
bool bogus = false;
bool dirty = false;
@@ -815,13 +815,21 @@ vac_update_datfrozenxid(void)
* committed pg_class entries for new tables; see AddNewRelationTuple().
* So we cannot produce a wrong minimum by starting with this.
*/
- newFrozenXid = lastSaneFrozenXid = GetOldestXmin(true, true);
+ newFrozenXid = GetOldestXmin(true, true);
/*
* Similarly, initialize the MultiXact "min" with the value that would be
* used on pg_class for new tables. See AddNewRelationTuple().
*/
- newMinMulti = lastSaneMinMulti = GetOldestMultiXactId();
+ newMinMulti = GetOldestMultiXactId();
+
+ /*
+ * Identify the latest relfrozenxid and relminmxid values that we could
+ * validly see during the scan. These are conservative values, but it's
+ * not really worth trying to be more exact.
+ */
+ lastSaneFrozenXid = ReadNewTransactionId();
+ lastSaneMinMulti = ReadNextMultiXactId();
/*
* We must seqscan pg_class to find the minimum Xid, because there is no