32#define VAR_OID_PREFETCH 8192
78 elog(
ERROR,
"cannot assign TransactionIds during a parallel operation");
94 elog(
ERROR,
"cannot assign TransactionIds during recovery");
146 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
147 errmsg(
"database is not accepting commands that assign new transaction IDs to avoid wraparound data loss in database \"%s\"",
149 errhint(
"Execute a database-wide VACUUM in that database.\n"
150 "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
153 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
154 errmsg(
"database is not accepting commands that assign new transaction IDs to avoid wraparound data loss in database with OID %u",
156 errhint(
"Execute a database-wide VACUUM in that database.\n"
157 "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
166 (
errmsg(
"database \"%s\" must be vacuumed within %u transactions",
169 errdetail(
"Approximately %.2f%% of transaction IDs are available for use.",
171 errhint(
"To avoid transaction ID assignment failures, execute a database-wide VACUUM in that database.\n"
172 "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
175 (
errmsg(
"database with OID %u must be vacuumed within %u transactions",
178 errdetail(
"Approximately %.2f%% of transaction IDs are available for use.",
180 errhint(
"To avoid XID assignment failures, execute a database-wide VACUUM in that database.\n"
181 "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
354 oldest_datfrozenxid))
400 xidStopLimit = xidWrapLimit - 3000000;
414 xidWarnLimit = xidWrapLimit - 100000000;
450 (
errmsg_internal(
"transaction ID wrap limit is %u, limited by database with OID %u",
451 xidWrapLimit, oldest_datoid)));
467 char *oldest_datname;
481 oldest_datname = NULL;
485 (
errmsg(
"database \"%s\" must be vacuumed within %u transactions",
487 xidWrapLimit - curXid),
488 errdetail(
"Approximately %.2f%% of transaction IDs are available for use.",
490 errhint(
"To avoid XID assignment failures, execute a database-wide VACUUM in that database.\n"
491 "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
494 (
errmsg(
"database with OID %u must be vacuumed within %u transactions",
496 xidWrapLimit - curXid),
497 errdetail(
"Approximately %.2f%% of transaction IDs are available for use.",
499 errhint(
"To avoid XID assignment failures, execute a database-wide VACUUM in that database.\n"
500 "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
560 elog(
ERROR,
"cannot assign OIDs during recovery");
626 elog(
ERROR,
"cannot advance OID counter anymore");
632 elog(
ERROR,
"too late to advance OID counter to %u, it is now %u",
657#ifdef USE_ASSERT_CHECKING
#define pg_memory_barrier()
#define pg_write_barrier()
int autovacuum_freeze_max_age
#define Assert(condition)
void ExtendCLOG(TransactionId newestXact)
void ExtendCommitTs(TransactionId newestXact)
int errcode(int sqlerrcode)
int errhint(const char *fmt,...) pg_attribute_printf(1
int errdetail(const char *fmt,...) pg_attribute_printf(1
int int errmsg_internal(const char *fmt,...) pg_attribute_printf(1
#define ereport(elevel,...)
bool IsPostmasterEnvironment
char * get_database_name(Oid dbid)
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
void LWLockRelease(LWLock *lock)
#define AmStartupProcess()
#define IsBootstrapProcessingMode()
void SendPostmasterSignal(PMSignalReason reason)
@ PMSIGNAL_START_AUTOVAC_LAUNCHER
static Datum ObjectIdGetDatum(Oid X)
#define PGPROC_MAX_CACHED_SUBXIDS
#define ShmemRequestStruct(...)
XidCacheStatus subxidStatus
XidCacheStatus * subxidStates
ShmemRequestCallback request_fn
TransactionId xidStopLimit
TransactionId xidWarnLimit
TransactionId xidWrapLimit
FullTransactionId nextXid
TransactionId xidVacLimit
TransactionId oldestClogXid
TransactionId xids[PGPROC_MAX_CACHED_SUBXIDS]
void ExtendSUBTRANS(TransactionId newestXact)
#define SearchSysCacheExists1(cacheId, key1)
#define FirstUnpinnedObjectId
#define EpochFromFullTransactionId(x)
static bool TransactionIdPrecedesOrEquals(TransactionId id1, TransactionId id2)
static bool TransactionIdFollowsOrEquals(TransactionId id1, TransactionId id2)
#define AssertTransactionIdInAllowableRange(xid)
#define BootstrapTransactionId
#define XidFromFullTransactionId(x)
#define FirstGenbkiObjectId
#define FirstNormalTransactionId
static void FullTransactionIdAdvance(FullTransactionId *dest)
#define FirstNormalObjectId
#define TransactionIdIsValid(xid)
static FullTransactionId FullTransactionIdFromEpochAndXid(uint32 epoch, TransactionId xid)
#define TransactionIdIsNormal(xid)
#define TransactionIdAdvance(dest)
static bool TransactionIdPrecedes(TransactionId id1, TransactionId id2)
static void SetNextObjectId(Oid nextOid)
FullTransactionId ReadNextFullTransactionId(void)
void AdvanceNextFullTransactionIdPastXid(TransactionId xid)
void SetTransactionIdLimit(TransactionId oldest_datfrozenxid, Oid oldest_datoid)
FullTransactionId GetNewTransactionId(bool isSubXact)
void StopGeneratingPinnedObjectIds(void)
bool ForceTransactionIdLimitUpdate(void)
void AdvanceOldestClogXid(TransactionId oldest_datfrozenxid)
static void VarsupShmemRequest(void *arg)
const ShmemCallbacks VarsupShmemCallbacks
TransamVariablesData * TransamVariables
static const unsigned __int64 epoch
bool IsTransactionState(void)
bool IsInParallelMode(void)
bool RecoveryInProgress(void)
void XLogPutNextOid(Oid nextOid)