31 #define VAR_OID_PREFETCH 8192
87 elog(
ERROR,
"cannot assign TransactionIds during a parallel operation");
103 elog(
ERROR,
"cannot assign TransactionIds during recovery");
155 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
156 errmsg(
"database is not accepting commands that assign new transaction IDs to avoid wraparound data loss in database \"%s\"",
158 errhint(
"Execute a database-wide VACUUM in that database.\n"
159 "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
162 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
163 errmsg(
"database is not accepting commands that assign new transaction IDs to avoid wraparound data loss in database with OID %u",
165 errhint(
"Execute a database-wide VACUUM in that database.\n"
166 "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
175 (
errmsg(
"database \"%s\" must be vacuumed within %u transactions",
178 errhint(
"To avoid transaction ID assignment failures, execute a database-wide VACUUM in that database.\n"
179 "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
182 (
errmsg(
"database with OID %u must be vacuumed within %u transactions",
185 errhint(
"To avoid XID assignment failures, execute a database-wide VACUUM in that database.\n"
186 "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
359 oldest_datfrozenxid))
405 xidStopLimit = xidWrapLimit - 3000000;
419 xidWarnLimit = xidWrapLimit - 40000000;
455 (
errmsg_internal(
"transaction ID wrap limit is %u, limited by database with OID %u",
456 xidWrapLimit, oldest_datoid)));
472 char *oldest_datname;
486 oldest_datname = NULL;
490 (
errmsg(
"database \"%s\" must be vacuumed within %u transactions",
492 xidWrapLimit - curXid),
493 errhint(
"To avoid XID assignment failures, execute a database-wide VACUUM in that database.\n"
494 "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
497 (
errmsg(
"database with OID %u must be vacuumed within %u transactions",
499 xidWrapLimit - curXid),
500 errhint(
"To avoid XID assignment failures, execute a database-wide VACUUM in that database.\n"
501 "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
561 elog(
ERROR,
"cannot assign OIDs during recovery");
627 elog(
ERROR,
"cannot advance OID counter anymore");
633 elog(
ERROR,
"too late to advance OID counter to %u, it is now %u",
658 #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)
char * get_database_name(Oid dbid)
int errmsg_internal(const char *fmt,...)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
bool IsPostmasterEnvironment
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
void * ShmemInitStruct(const char *name, Size size, bool *foundPtr)
XidCacheStatus subxidStatus
XidCacheStatus * subxidStates
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)
bool TransactionIdPrecedes(TransactionId id1, TransactionId id2)
bool TransactionIdPrecedesOrEquals(TransactionId id1, TransactionId id2)
bool TransactionIdFollowsOrEquals(TransactionId id1, TransactionId id2)
#define FirstUnpinnedObjectId
#define EpochFromFullTransactionId(x)
#define AssertTransactionIdInAllowableRange(xid)
#define BootstrapTransactionId
#define XidFromFullTransactionId(x)
#define FirstGenbkiObjectId
#define FirstNormalTransactionId
static void FullTransactionIdAdvance(FullTransactionId *dest)
struct TransamVariablesData TransamVariablesData
#define FirstNormalObjectId
#define TransactionIdIsValid(xid)
static FullTransactionId FullTransactionIdFromEpochAndXid(uint32 epoch, TransactionId xid)
#define TransactionIdIsNormal(xid)
#define TransactionIdAdvance(dest)
static void SetNextObjectId(Oid nextOid)
FullTransactionId ReadNextFullTransactionId(void)
void AdvanceNextFullTransactionIdPastXid(TransactionId xid)
void SetTransactionIdLimit(TransactionId oldest_datfrozenxid, Oid oldest_datoid)
Size VarsupShmemSize(void)
FullTransactionId GetNewTransactionId(bool isSubXact)
void StopGeneratingPinnedObjectIds(void)
bool ForceTransactionIdLimitUpdate(void)
void AdvanceOldestClogXid(TransactionId oldest_datfrozenxid)
void VarsupShmemInit(void)
TransamVariablesData * TransamVariables
static const unsigned __int64 epoch
bool IsTransactionState(void)
bool IsInParallelMode(void)
bool RecoveryInProgress(void)
void XLogPutNextOid(Oid nextOid)