* relations that's not required, since only backends in my own database could
* ever see the tuples in them. Also, we can ignore concurrently running lazy
* VACUUMs because (a) they must be working on other tables, and (b) they
- * don't need to do snapshot-based lookups. Similarly, for the non-catalog
- * horizon, we can ignore CREATE INDEX CONCURRENTLY and REINDEX CONCURRENTLY
- * when they are working on non-partial, non-expressional indexes, for the
- * same reasons and because they can't run in transaction blocks. (They are
- * not possible to ignore for catalogs, because CIC and RC do some catalog
- * operations.) Do note that this means that CIC and RC must use a lock level
- * that conflicts with VACUUM.
+ * don't need to do snapshot-based lookups.
*
* This also computes a horizon used to truncate pg_subtrans. For that
* backends in all databases have to be considered, and concurrently running
bool in_recovery = RecoveryInProgress();
TransactionId *other_xids = ProcGlobal->xids;
+ /* inferred after ProcArrayLock is released */
+ h->catalog_oldest_nonremovable = InvalidTransactionId;
+
LWLockAcquire(ProcArrayLock, LW_SHARED);
h->latest_completed = ShmemVariableCache->latestCompletedXid;
h->oldest_considered_running = initial;
h->shared_oldest_nonremovable = initial;
- h->catalog_oldest_nonremovable = initial;
h->data_oldest_nonremovable = initial;
/*
(statusFlags & PROC_AFFECTS_ALL_HORIZONS) ||
in_recovery)
{
- /*
- * We can ignore this backend if it's running CREATE INDEX
- * CONCURRENTLY or REINDEX CONCURRENTLY on a "safe" index -- but
- * only on vacuums of user-defined tables.
- */
- if (!(statusFlags & PROC_IN_SAFE_IC))
- h->data_oldest_nonremovable =
- TransactionIdOlder(h->data_oldest_nonremovable, xmin);
-
- /* Catalog tables need to consider all backends in this db */
- h->catalog_oldest_nonremovable =
- TransactionIdOlder(h->catalog_oldest_nonremovable, xmin);
+ h->data_oldest_nonremovable =
+ TransactionIdOlder(h->data_oldest_nonremovable, xmin);
}
}
- /* catalog horizon should never be later than data */
- Assert(TransactionIdPrecedesOrEquals(h->catalog_oldest_nonremovable,
- h->data_oldest_nonremovable));
-
/*
* If in recovery fetch oldest xid in KnownAssignedXids, will be applied
* after lock is released.
TransactionIdOlder(h->shared_oldest_nonremovable, kaxmin);
h->data_oldest_nonremovable =
TransactionIdOlder(h->data_oldest_nonremovable, kaxmin);
- h->catalog_oldest_nonremovable =
- TransactionIdOlder(h->catalog_oldest_nonremovable, kaxmin);
/* temp relations cannot be accessed in recovery */
}
else
h->data_oldest_nonremovable =
TransactionIdRetreatedBy(h->data_oldest_nonremovable,
vacuum_defer_cleanup_age);
- h->catalog_oldest_nonremovable =
- TransactionIdRetreatedBy(h->catalog_oldest_nonremovable,
- vacuum_defer_cleanup_age);
/* defer doesn't apply to temp relations */
}
h->shared_oldest_nonremovable =
TransactionIdOlder(h->shared_oldest_nonremovable,
h->slot_catalog_xmin);
- h->catalog_oldest_nonremovable =
- TransactionIdOlder(h->catalog_oldest_nonremovable,
- h->slot_xmin);
+ h->catalog_oldest_nonremovable = h->data_oldest_nonremovable;
h->catalog_oldest_nonremovable =
TransactionIdOlder(h->catalog_oldest_nonremovable,
h->slot_catalog_xmin);