mirror of
https://github.com/postgres/postgres.git
synced 2025-10-21 02:52:47 +03:00
Rename various "freeze multixact" variables
It seems to make more sense to use "cutoff multixact" terminology throughout the backend code; "freeze" is associated with replacing of an Xid with FrozenTransactionId, which is not what we do for MultiXactIds. Andres Freund Some adjustments by Álvaro Herrera
This commit is contained in:
@@ -64,7 +64,7 @@ static BufferAccessStrategy vac_strategy;
|
||||
|
||||
/* non-export function prototypes */
|
||||
static List *get_rel_oids(Oid relid, const RangeVar *vacrel);
|
||||
static void vac_truncate_clog(TransactionId frozenXID, MultiXactId frozenMulti);
|
||||
static void vac_truncate_clog(TransactionId frozenXID, MultiXactId minMulti);
|
||||
static bool vacuum_rel(Oid relid, VacuumStmt *vacstmt, bool do_toast,
|
||||
bool for_wraparound);
|
||||
|
||||
@@ -384,7 +384,7 @@ vacuum_set_xid_limits(int freeze_min_age,
|
||||
TransactionId *oldestXmin,
|
||||
TransactionId *freezeLimit,
|
||||
TransactionId *freezeTableLimit,
|
||||
MultiXactId *multiXactFrzLimit)
|
||||
MultiXactId *multiXactCutoff)
|
||||
{
|
||||
int freezemin;
|
||||
TransactionId limit;
|
||||
@@ -469,7 +469,7 @@ vacuum_set_xid_limits(int freeze_min_age,
|
||||
*freezeTableLimit = limit;
|
||||
}
|
||||
|
||||
if (multiXactFrzLimit != NULL)
|
||||
if (multiXactCutoff != NULL)
|
||||
{
|
||||
MultiXactId mxLimit;
|
||||
|
||||
@@ -481,7 +481,7 @@ vacuum_set_xid_limits(int freeze_min_age,
|
||||
if (mxLimit < FirstMultiXactId)
|
||||
mxLimit = FirstMultiXactId;
|
||||
|
||||
*multiXactFrzLimit = mxLimit;
|
||||
*multiXactCutoff = mxLimit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -690,8 +690,8 @@ vac_update_relstats(Relation relation,
|
||||
* Update pg_database's datfrozenxid entry for our database to be the
|
||||
* minimum of the pg_class.relfrozenxid values.
|
||||
*
|
||||
* Similarly, update our datfrozenmulti to be the minimum of the
|
||||
* pg_class.relfrozenmulti values.
|
||||
* Similarly, update our datminmxid to be the minimum of the
|
||||
* pg_class.relminmxid values.
|
||||
*
|
||||
* If we are able to advance either pg_database value, also try to
|
||||
* truncate pg_clog and pg_multixact.
|
||||
@@ -711,7 +711,7 @@ vac_update_datfrozenxid(void)
|
||||
SysScanDesc scan;
|
||||
HeapTuple classTup;
|
||||
TransactionId newFrozenXid;
|
||||
MultiXactId newFrozenMulti;
|
||||
MultiXactId newMinMulti;
|
||||
bool dirty = false;
|
||||
|
||||
/*
|
||||
@@ -726,7 +726,7 @@ vac_update_datfrozenxid(void)
|
||||
* Similarly, initialize the MultiXact "min" with the value that would be
|
||||
* used on pg_class for new tables. See AddNewRelationTuple().
|
||||
*/
|
||||
newFrozenMulti = GetOldestMultiXactId();
|
||||
newMinMulti = GetOldestMultiXactId();
|
||||
|
||||
/*
|
||||
* We must seqscan pg_class to find the minimum Xid, because there is no
|
||||
@@ -756,8 +756,8 @@ vac_update_datfrozenxid(void)
|
||||
if (TransactionIdPrecedes(classForm->relfrozenxid, newFrozenXid))
|
||||
newFrozenXid = classForm->relfrozenxid;
|
||||
|
||||
if (MultiXactIdPrecedes(classForm->relminmxid, newFrozenMulti))
|
||||
newFrozenMulti = classForm->relminmxid;
|
||||
if (MultiXactIdPrecedes(classForm->relminmxid, newMinMulti))
|
||||
newMinMulti = classForm->relminmxid;
|
||||
}
|
||||
|
||||
/* we're done with pg_class */
|
||||
@@ -765,7 +765,7 @@ vac_update_datfrozenxid(void)
|
||||
heap_close(relation, AccessShareLock);
|
||||
|
||||
Assert(TransactionIdIsNormal(newFrozenXid));
|
||||
Assert(MultiXactIdIsValid(newFrozenMulti));
|
||||
Assert(MultiXactIdIsValid(newMinMulti));
|
||||
|
||||
/* Now fetch the pg_database tuple we need to update. */
|
||||
relation = heap_open(DatabaseRelationId, RowExclusiveLock);
|
||||
@@ -787,9 +787,9 @@ vac_update_datfrozenxid(void)
|
||||
}
|
||||
|
||||
/* ditto */
|
||||
if (MultiXactIdPrecedes(dbform->datminmxid, newFrozenMulti))
|
||||
if (MultiXactIdPrecedes(dbform->datminmxid, newMinMulti))
|
||||
{
|
||||
dbform->datminmxid = newFrozenMulti;
|
||||
dbform->datminmxid = newMinMulti;
|
||||
dirty = true;
|
||||
}
|
||||
|
||||
@@ -805,7 +805,7 @@ vac_update_datfrozenxid(void)
|
||||
* this action will update that too.
|
||||
*/
|
||||
if (dirty || ForceTransactionIdLimitUpdate())
|
||||
vac_truncate_clog(newFrozenXid, newFrozenMulti);
|
||||
vac_truncate_clog(newFrozenXid, newMinMulti);
|
||||
}
|
||||
|
||||
|
||||
@@ -824,19 +824,19 @@ vac_update_datfrozenxid(void)
|
||||
* info is stale.
|
||||
*/
|
||||
static void
|
||||
vac_truncate_clog(TransactionId frozenXID, MultiXactId frozenMulti)
|
||||
vac_truncate_clog(TransactionId frozenXID, MultiXactId minMulti)
|
||||
{
|
||||
TransactionId myXID = GetCurrentTransactionId();
|
||||
Relation relation;
|
||||
HeapScanDesc scan;
|
||||
HeapTuple tuple;
|
||||
Oid oldestxid_datoid;
|
||||
Oid oldestmulti_datoid;
|
||||
Oid minmulti_datoid;
|
||||
bool frozenAlreadyWrapped = false;
|
||||
|
||||
/* init oldest datoids to sync with my frozen values */
|
||||
oldestxid_datoid = MyDatabaseId;
|
||||
oldestmulti_datoid = MyDatabaseId;
|
||||
minmulti_datoid = MyDatabaseId;
|
||||
|
||||
/*
|
||||
* Scan pg_database to compute the minimum datfrozenxid
|
||||
@@ -869,10 +869,10 @@ vac_truncate_clog(TransactionId frozenXID, MultiXactId frozenMulti)
|
||||
oldestxid_datoid = HeapTupleGetOid(tuple);
|
||||
}
|
||||
|
||||
if (MultiXactIdPrecedes(dbform->datminmxid, frozenMulti))
|
||||
if (MultiXactIdPrecedes(dbform->datminmxid, minMulti))
|
||||
{
|
||||
frozenMulti = dbform->datminmxid;
|
||||
oldestmulti_datoid = HeapTupleGetOid(tuple);
|
||||
minMulti = dbform->datminmxid;
|
||||
minmulti_datoid = HeapTupleGetOid(tuple);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -896,7 +896,7 @@ vac_truncate_clog(TransactionId frozenXID, MultiXactId frozenMulti)
|
||||
|
||||
/* Truncate CLOG and Multi to the oldest computed value */
|
||||
TruncateCLOG(frozenXID);
|
||||
TruncateMultiXact(frozenMulti);
|
||||
TruncateMultiXact(minMulti);
|
||||
|
||||
/*
|
||||
* Update the wrap limit for GetNewTransactionId and creation of new
|
||||
@@ -905,7 +905,7 @@ vac_truncate_clog(TransactionId frozenXID, MultiXactId frozenMulti)
|
||||
* signalling twice?
|
||||
*/
|
||||
SetTransactionIdLimit(frozenXID, oldestxid_datoid);
|
||||
MultiXactAdvanceOldest(frozenMulti, oldestmulti_datoid);
|
||||
MultiXactAdvanceOldest(minMulti, minmulti_datoid);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user