105#define MULTIXACT_OFFSETS_PER_PAGE (BLCKSZ / sizeof(MultiXactOffset))
138#define MXACT_MEMBER_BITS_PER_XACT 8
139#define MXACT_MEMBER_FLAGS_PER_BYTE 1
140#define MXACT_MEMBER_XACT_BITMASK ((1 << MXACT_MEMBER_BITS_PER_XACT) - 1)
143#define MULTIXACT_FLAGBYTES_PER_GROUP 4
144#define MULTIXACT_MEMBERS_PER_MEMBERGROUP \
145 (MULTIXACT_FLAGBYTES_PER_GROUP * MXACT_MEMBER_FLAGS_PER_BYTE)
147#define MULTIXACT_MEMBERGROUP_SIZE \
148 (sizeof(TransactionId) * MULTIXACT_MEMBERS_PER_MEMBERGROUP + MULTIXACT_FLAGBYTES_PER_GROUP)
149#define MULTIXACT_MEMBERGROUPS_PER_PAGE (BLCKSZ / MULTIXACT_MEMBERGROUP_SIZE)
150#define MULTIXACT_MEMBERS_PER_PAGE \
151 (MULTIXACT_MEMBERGROUPS_PER_PAGE * MULTIXACT_MEMBERS_PER_MEMBERGROUP)
163#define MAX_MEMBERS_IN_LAST_MEMBERS_PAGE \
164 ((uint32) ((0xFFFFFFFF % MULTIXACT_MEMBERS_PER_PAGE) + 1))
211#define MULTIXACT_MEMBER_SAFE_THRESHOLD (MaxMultiXactOffset / 2)
212#define MULTIXACT_MEMBER_DANGER_THRESHOLD \
213 (MaxMultiXactOffset - MaxMultiXactOffset / 4)
227#define MultiXactOffsetCtl (&MultiXactOffsetCtlData)
228#define MultiXactMemberCtl (&MultiXactMemberCtlData)
326#define MaxOldestSlot (MaxBackends + max_prepared_xacts)
359#define MAX_CACHE_ENTRIES 256
363#ifdef MULTIXACT_DEBUG
364#define debug_elog2(a,b) elog(a,b)
365#define debug_elog3(a,b,c) elog(a,b,c)
366#define debug_elog4(a,b,c,d) elog(a,b,c,d)
367#define debug_elog5(a,b,c,d,e) elog(a,b,c,d,e)
368#define debug_elog6(a,b,c,d,e,f) elog(a,b,c,d,e,f)
370#define debug_elog2(a,b)
371#define debug_elog3(a,b,c)
372#define debug_elog4(a,b,c,d)
373#define debug_elog5(a,b,c,d,e)
374#define debug_elog6(a,b,c,d,e,f)
438 members[0].
xid = xid1;
439 members[0].
status = status1;
440 members[1].
xid = xid2;
441 members[1].
status = status2;
520 for (
i = 0;
i < nmembers;
i++)
523 (members[
i].status == status))
548 for (
i = 0,
j = 0;
i < nmembers;
i++)
559 newMembers[
j].
xid = xid;
560 newMembers[
j++].
status = status;
610 for (
i = 0;
i < nmembers;
i++)
625 for (
i = 0;
i < nmembers;
i++)
738 oldestMXact = thisoldest;
828 bool has_update =
false;
830 for (
i = 0;
i < nmembers;
i++)
835 elog(
ERROR,
"new multixact has more than one updating member: %s",
950 if (*offptr != offset)
961 if (next_pageno == pageno)
963 next_offptr = offptr + 1;
977 next_offptr += next_entryno;
981 next_offset = offset + nmembers;
982 if (next_offset == 0)
984 if (*next_offptr != next_offset)
987 Assert(*next_offptr == 0);
988 *next_offptr = next_offset;
997 for (
int i = 0;
i < nmembers;
i++, offset++)
1013 if (pageno != prev_pageno)
1021 if (lock != prevlock)
1023 if (prevlock != NULL)
1030 prev_pageno = pageno;
1036 *memberptr = members[
i].
xid;
1041 flagsval = *flagsptr;
1043 flagsval |= (members[
i].
status << bshift);
1044 *flagsptr = flagsval;
1049 if (prevlock != NULL)
1078 elog(
ERROR,
"cannot assign MultiXactIds during recovery");
1133 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
1134 errmsg(
"database is not accepting commands that assign new MultiXactIds to avoid wraparound data loss in database \"%s\"",
1136 errhint(
"Execute a database-wide VACUUM in that database.\n"
1137 "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
1140 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
1141 errmsg(
"database is not accepting commands that assign new MultiXactIds to avoid wraparound data loss in database with OID %u",
1143 errhint(
"Execute a database-wide VACUUM in that database.\n"
1144 "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
1162 (
errmsg_plural(
"database \"%s\" must be vacuumed before %u more MultiXactId is used",
1163 "database \"%s\" must be vacuumed before %u more MultiXactIds are used",
1164 multiWrapLimit - result,
1166 multiWrapLimit - result),
1167 errhint(
"Execute a database-wide VACUUM in that database.\n"
1168 "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
1171 (
errmsg_plural(
"database with OID %u must be vacuumed before %u more MultiXactId is used",
1172 "database with OID %u must be vacuumed before %u more MultiXactIds are used",
1173 multiWrapLimit - result,
1175 multiWrapLimit - result),
1176 errhint(
"Execute a database-wide VACUUM in that database.\n"
1177 "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
1199 if (nextOffset == 0)
1205 *offset = nextOffset;
1225#define OFFSET_WARN_SEGMENTS 20
1234 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
1235 errmsg(
"multixact \"members\" limit exceeded"),
1236 errdetail_plural(
"This command would create a multixact with %u members, but the remaining space is only enough for %u member.",
1237 "This command would create a multixact with %u members, but the remaining space is only enough for %u members.",
1241 errhint(
"Execute a database-wide VACUUM in database with OID %u with reduced \"vacuum_multixact_freeze_min_age\" and \"vacuum_multixact_freeze_table_age\" settings.",
1271 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
1272 errmsg_plural(
"database with OID %u must be vacuumed before %d more multixact member is used",
1273 "database with OID %u must be vacuumed before %d more multixact members are used",
1277 errhint(
"Execute a database-wide VACUUM in that database with reduced \"vacuum_multixact_freeze_min_age\" and \"vacuum_multixact_freeze_table_age\" settings.")));
1340 bool from_pgupgrade,
bool isLockOnly)
1411 (
errcode(ERRCODE_INTERNAL_ERROR),
1412 errmsg(
"MultiXactId %u does no longer exist -- apparent wraparound",
1417 (
errcode(ERRCODE_INTERNAL_ERROR),
1418 errmsg(
"MultiXactId %u has not been created yet -- apparent wraparound",
1457 tmpMXact = multi + 1;
1461 prev_pageno = pageno;
1466 if (pageno != prev_pageno)
1476 if (newlock != lock)
1487 nextMXOffset = *offptr;
1489 if (nextMXOffset == 0)
1492 errmsg(
"MultiXact %u has invalid next offset",
1495 length = nextMXOffset - offset;
1506 for (
int i = 0;
i < length;
i++, offset++)
1517 if (pageno != prev_pageno)
1527 if (newlock != lock)
1536 prev_pageno = pageno;
1553 ptr[truelength].
xid = *xactptr;
1587 if (member1.
xid > member2.
xid)
1589 if (member1.
xid < member2.
xid)
1638 return entry->
multi;
1666 if (entry->
multi == multi)
1674 memcpy(ptr, entry->
members, size);
1714 "MultiXact cache context",
1723 entry->
multi = multi;
1756 return "fornokeyupd";
1764 elog(
ERROR,
"unrecognized multixact status %d", status);
1772 static char *
str = NULL;
1784 for (
i = 1;
i < nmembers;
i++)
1945#define SHARED_MULTIXACT_STATE_SIZE \
1946 add_size(offsetof(MultiXactStateData, perBackendXactIds), \
1947 mul_size(sizeof(MultiXactId) * 2, MaxOldestSlot))
1968 "pg_multixact/offsets", LWTRANCHE_MULTIXACTOFFSET_BUFFER,
1969 LWTRANCHE_MULTIXACTOFFSET_SLRU,
1975 "pg_multixact/members", LWTRANCHE_MULTIXACTMEMBER_BUFFER,
1976 LWTRANCHE_MULTIXACTMEMBER_SLRU,
2196 MemSet(xidptr, 0, BLCKSZ - memberoff);
2235 "MultiXact: checkpoint is nextMulti %u, nextOffset %u, oldestMulti %u in DB %u",
2236 *nextMulti, *nextMultiOffset, *oldestMulti, *oldestMultiDB);
2245 TRACE_POSTGRESQL_MULTIXACT_CHECKPOINT_START(
true);
2255 TRACE_POSTGRESQL_MULTIXACT_CHECKPOINT_DONE(
true);
2271 nextMulti, nextMultiOffset);
2309 bool needs_offset_vacuum;
2328 multiStopLimit = multiWrapLimit - 3000000;
2342 multiWarnLimit = multiWrapLimit - 40000000;
2371 (
errmsg_internal(
"MultiXactId wrap limit is %u, limited by database with OID %u",
2372 multiWrapLimit, oldest_datoid)));
2403 char *oldest_datname;
2417 oldest_datname = NULL;
2421 (
errmsg_plural(
"database \"%s\" must be vacuumed before %u more MultiXactId is used",
2422 "database \"%s\" must be vacuumed before %u more MultiXactIds are used",
2423 multiWrapLimit - curMulti,
2425 multiWrapLimit - curMulti),
2426 errhint(
"To avoid MultiXactId assignment failures, execute a database-wide VACUUM in that database.\n"
2427 "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
2430 (
errmsg_plural(
"database with OID %u must be vacuumed before %u more MultiXactId is used",
2431 "database with OID %u must be vacuumed before %u more MultiXactIds are used",
2432 multiWrapLimit - curMulti,
2434 multiWrapLimit - curMulti),
2435 errhint(
"To avoid MultiXactId assignment failures, execute a database-wide VACUUM in that database.\n"
2436 "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
2534 while (nmembers > 0)
2545 if (flagsoff == 0 && flagsbit == 0)
2624 oldestMXact = nextMXact;
2632 oldestMXact = thisoldest;
2636 oldestMXact = thisoldest;
2663 bool oldestOffsetKnown =
false;
2664 bool prevOldestOffsetKnown;
2692 if (oldestMultiXactId == nextMXact)
2698 oldestOffset = nextOffset;
2699 oldestOffsetKnown =
true;
2712 if (oldestOffsetKnown)
2718 (
errmsg(
"MultiXact member wraparound protections are disabled because oldest checkpointed MultiXact %u does not exist on disk",
2719 oldestMultiXactId)));
2729 if (oldestOffsetKnown)
2732 offsetStopLimit = oldestOffset - (oldestOffset %
2738 if (!prevOldestOffsetKnown && !is_startup)
2740 (
errmsg(
"MultiXact member wraparound protections are now enabled")));
2743 (
errmsg_internal(
"MultiXact member stop limit is now %u based on MultiXact %u",
2744 offsetStopLimit, oldestMultiXactId)));
2746 else if (prevOldestOffsetKnown)
2754 oldestOffset = prevOldestOffset;
2755 oldestOffsetKnown =
true;
2756 offsetStopLimit = prevOffsetStopLimit;
2769 return !oldestOffsetKnown ||
2792 finish =
start + distance;
2815 if (
start < boundary)
2816 return finish >= boundary || finish <
start;
2818 return finish >= boundary && finish <
start;
2881 bool oldestOffsetKnown;
2891 if (!oldestOffsetKnown)
2900 *members = nextOffset - *oldestOffset;
2901 *multixacts = nextMultiXactId - *oldestMultiXactId;
2937 uint32 victim_multixacts;
2944 if (!
GetMultiXactInfo(&multixacts, &members, &oldestMultiXactId, &oldestOffset))
2958 victim_multixacts = multixacts * fraction;
2961 if (victim_multixacts > multixacts)
2963 result = multixacts - victim_multixacts;
3010 int64 segment = startsegment;
3016 while (segment != endsegment)
3018 elog(
DEBUG2,
"truncating multixact members segment %" PRIx64,
3023 if (segment == maxsegment)
3137 if (oldestMulti == nextMulti)
3140 oldestOffset = nextOffset;
3145 (
errmsg(
"oldest MultiXact %u not found, earliest MultiXact %u, skipping truncation",
3146 oldestMulti, earliest)));
3155 if (newOldestMulti == nextMulti)
3158 newOldestOffset = nextOffset;
3163 (
errmsg(
"cannot truncate up to MultiXact %u because it does not exist on disk, skipping truncation",
3169 elog(
DEBUG1,
"performing multixact truncation: "
3170 "offsets [%u, %u), offsets segments [%" PRIx64
", %" PRIx64
"), "
3171 "members [%u, %u), members segments [%" PRIx64
", %" PRIx64
")",
3172 oldestMulti, newOldestMulti,
3175 oldestOffset, newOldestOffset,
3198 oldestMulti, newOldestMulti,
3199 oldestOffset, newOldestOffset);
3397 elog(
DEBUG1,
"replaying multixact truncation: "
3398 "offsets [%u, %u), offsets segments [%" PRIx64
", %" PRIx64
"), "
3399 "members [%u, %u), members segments [%" PRIx64
", %" PRIx64
")",
3431 elog(
PANIC,
"multixact_redo: unknown op code %u", info);
static void pg_atomic_write_u64(volatile pg_atomic_uint64 *ptr, uint64 val)
int autovacuum_multixact_freeze_max_age
TransactionId MultiXactId
#define FLEXIBLE_ARRAY_MEMBER
#define MemSet(start, val, len)
int errmsg_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...)
int errmsg_internal(const char *fmt,...)
int errdetail_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
Datum difference(PG_FUNCTION_ARGS)
int multixact_offset_buffers
int multixact_member_buffers
Assert(PointerIsAligned(start, uint64))
#define dclist_container(type, membername, ptr)
static uint32 dclist_count(const dclist_head *head)
static void dclist_move_head(dclist_head *head, dlist_node *node)
static dlist_node * dclist_tail_node(dclist_head *head)
static void dclist_delete_from(dclist_head *head, dlist_node *node)
#define DCLIST_STATIC_INIT(name)
static void dclist_push_head(dclist_head *head, dlist_node *node)
static void dclist_init(dclist_head *head)
#define dclist_foreach(iter, lhead)
#define INJECTION_POINT_CACHED(name, arg)
#define INJECTION_POINT_LOAD(name)
if(TABLE==NULL||TABLE_index==NULL)
char * get_database_name(Oid dbid)
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
void LWLockRelease(LWLock *lock)
char * MemoryContextStrdup(MemoryContext context, const char *string)
void * MemoryContextAlloc(MemoryContext context, Size size)
MemoryContext TopTransactionContext
void pfree(void *pointer)
MemoryContext TopMemoryContext
#define AllocSetContextCreate
#define ALLOCSET_SMALL_SIZES
#define START_CRIT_SECTION()
#define END_CRIT_SECTION()
static void WriteMTruncateXlogRec(Oid oldestMultiDB, MultiXactId startTruncOff, MultiXactId endTruncOff, MultiXactOffset startTruncMemb, MultiXactOffset endTruncMemb)
static MultiXactId PreviousMultiXactId(MultiXactId multi)
static SlruCtlData MultiXactOffsetCtlData
void MultiXactShmemInit(void)
#define MULTIXACT_MEMBER_SAFE_THRESHOLD
static bool MultiXactMemberPagePrecedes(int64 page1, int64 page2)
static MultiXactId GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
static int mXactCacheGetById(MultiXactId multi, MultiXactMember **members)
MultiXactId MultiXactIdExpand(MultiXactId multi, TransactionId xid, MultiXactStatus status)
static int64 MXOffsetToMemberPage(MultiXactOffset offset)
#define MXACT_MEMBER_BITS_PER_XACT
static int64 MultiXactIdToOffsetSegment(MultiXactId multi)
static void ExtendMultiXactMember(MultiXactOffset offset, int nmembers)
void ReadMultiXactIdRange(MultiXactId *oldest, MultiXactId *next)
static void PerformOffsetsTruncation(MultiXactId oldestMulti, MultiXactId newOldestMulti)
#define MXACT_MEMBER_XACT_BITMASK
#define MULTIXACT_FLAGBYTES_PER_GROUP
bool MultiXactIdPrecedes(MultiXactId multi1, MultiXactId multi2)
char * mxstatus_to_string(MultiXactStatus status)
void multixact_redo(XLogReaderState *record)
#define MULTIXACT_OFFSETS_PER_PAGE
void multixact_twophase_postcommit(FullTransactionId fxid, uint16 info, void *recdata, uint32 len)
#define debug_elog5(a, b, c, d, e)
static void MultiXactIdSetOldestVisible(void)
int multixactoffsetssyncfiletag(const FileTag *ftag, char *path)
static bool find_multixact_start(MultiXactId multi, MultiXactOffset *result)
void PostPrepare_MultiXact(FullTransactionId fxid)
void MultiXactSetNextMXact(MultiXactId nextMulti, MultiXactOffset nextMultiOffset)
#define MultiXactMemberCtl
static bool SlruScanDirCbFindEarliest(SlruCtl ctl, char *filename, int64 segpage, void *data)
void AtPrepare_MultiXact(void)
static bool MultiXactOffsetWouldWrap(MultiXactOffset boundary, MultiXactOffset start, uint32 distance)
bool MultiXactIdPrecedesOrEquals(MultiXactId multi1, MultiXactId multi2)
void MultiXactAdvanceOldest(MultiXactId oldestMulti, Oid oldestMultiDB)
static int MultiXactIdToOffsetEntry(MultiXactId multi)
static void mXactCachePut(MultiXactId multi, int nmembers, MultiXactMember *members)
static void MaybeExtendOffsetSlru(void)
bool MultiXactIdIsRunning(MultiXactId multi, bool isLockOnly)
void MultiXactIdSetOldestMember(void)
static void PerformMembersTruncation(MultiXactOffset oldestOffset, MultiXactOffset newOldestOffset)
static MemoryContext MXactContext
#define SHARED_MULTIXACT_STATE_SIZE
static MultiXactId * OldestVisibleMXactId
struct mxtruncinfo mxtruncinfo
static int mxactMemberComparator(const void *arg1, const void *arg2)
struct MultiXactStateData MultiXactStateData
static void ExtendMultiXactOffset(MultiXactId multi)
Size MultiXactShmemSize(void)
#define MULTIXACT_MEMBERGROUPS_PER_PAGE
#define MultiXactOffsetCtl
static int MXOffsetToMemberOffset(MultiXactOffset offset)
void MultiXactGetCheckptMulti(bool is_shutdown, MultiXactId *nextMulti, MultiXactOffset *nextMultiOffset, MultiXactId *oldestMulti, Oid *oldestMultiDB)
void SetMultiXactIdLimit(MultiXactId oldest_datminmxid, Oid oldest_datoid, bool is_startup)
static void RecordNewMultiXact(MultiXactId multi, MultiXactOffset offset, int nmembers, MultiXactMember *members)
int multixactmemberssyncfiletag(const FileTag *ftag, char *path)
#define MAX_CACHE_ENTRIES
static int64 MultiXactIdToOffsetPage(MultiXactId multi)
MultiXactId GetOldestMultiXactId(void)
void CheckPointMultiXact(void)
MultiXactId MultiXactIdCreateFromMembers(int nmembers, MultiXactMember *members)
struct mXactCacheEnt mXactCacheEnt
static int64 MXOffsetToMemberSegment(MultiXactOffset offset)
static MultiXactId mXactCacheGetBySet(int nmembers, MultiXactMember *members)
static dclist_head MXactCache
#define debug_elog3(a, b, c)
char * mxid_to_string(MultiXactId multi, int nmembers, MultiXactMember *members)
#define MULTIXACT_MEMBERGROUP_SIZE
#define debug_elog4(a, b, c, d)
void multixact_twophase_postabort(FullTransactionId fxid, uint16 info, void *recdata, uint32 len)
static bool MultiXactOffsetPagePrecedes(int64 page1, int64 page2)
static bool SetOffsetVacuumLimit(bool is_startup)
static int MXOffsetToFlagsOffset(MultiXactOffset offset)
int MultiXactMemberFreezeThreshold(void)
void MultiXactAdvanceNextMXact(MultiXactId minMulti, MultiXactOffset minMultiOffset)
static MultiXactId * OldestMemberMXactId
#define MAX_MEMBERS_IN_LAST_MEMBERS_PAGE
static MultiXactStateData * MultiXactState
#define MULTIXACT_MEMBERS_PER_MEMBERGROUP
#define OFFSET_WARN_SEGMENTS
MultiXactId ReadNextMultiXactId(void)
void BootStrapMultiXact(void)
#define debug_elog6(a, b, c, d, e, f)
void multixact_twophase_recover(FullTransactionId fxid, uint16 info, void *recdata, uint32 len)
#define MULTIXACT_MEMBERS_PER_PAGE
MultiXactId MultiXactIdCreate(TransactionId xid1, MultiXactStatus status1, TransactionId xid2, MultiXactStatus status2)
void TruncateMultiXact(MultiXactId newOldestMulti, Oid newOldestMultiDB)
#define MULTIXACT_MEMBER_DANGER_THRESHOLD
static int MXOffsetToFlagsBitShift(MultiXactOffset offset)
bool check_multixact_offset_buffers(int *newval, void **extra, GucSource source)
static bool MultiXactOffsetPrecedes(MultiXactOffset offset1, MultiXactOffset offset2)
bool GetMultiXactInfo(uint32 *multixacts, MultiXactOffset *members, MultiXactId *oldestMultiXactId, MultiXactOffset *oldestOffset)
bool check_multixact_member_buffers(int *newval, void **extra, GucSource source)
void AtEOXact_MultiXact(void)
static SlruCtlData MultiXactMemberCtlData
#define debug_elog2(a, b)
void StartupMultiXact(void)
int GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **members, bool from_pgupgrade, bool isLockOnly)
#define MultiXactIdIsValid(multi)
#define XLOG_MULTIXACT_ZERO_MEM_PAGE
#define XLOG_MULTIXACT_ZERO_OFF_PAGE
@ MultiXactStatusForShare
@ MultiXactStatusForNoKeyUpdate
@ MultiXactStatusNoKeyUpdate
@ MultiXactStatusForUpdate
@ MultiXactStatusForKeyShare
#define ISUPDATE_from_mxstatus(status)
#define InvalidMultiXactId
#define XLOG_MULTIXACT_TRUNCATE_ID
#define SizeOfMultiXactCreate
#define SizeOfMultiXactTruncate
#define XLOG_MULTIXACT_CREATE_ID
#define MaxMultiXactOffset
struct MultiXactMember MultiXactMember
#define ERRCODE_DATA_CORRUPTED
#define SLRU_PAGES_PER_SEGMENT
static rewind_source * source
void SendPostmasterSignal(PMSignalReason reason)
@ PMSIGNAL_START_AUTOVAC_LAUNCHER
#define qsort(a, b, c, d)
#define DELAY_CHKPT_START
bool TransactionIdIsInProgress(TransactionId xid)
Size add_size(Size s1, Size s2)
void * ShmemInitStruct(const char *name, Size size, bool *foundPtr)
void SimpleLruInit(SlruCtl ctl, const char *name, int nslots, int nlsns, const char *subdir, int buffer_tranche_id, int bank_tranche_id, SyncRequestHandler sync_handler, bool long_segment_names)
int SimpleLruReadPage_ReadOnly(SlruCtl ctl, int64 pageno, TransactionId xid)
void SimpleLruWritePage(SlruCtl ctl, int slotno)
void SimpleLruWriteAll(SlruCtl ctl, bool allow_redirtied)
bool SimpleLruDoesPhysicalPageExist(SlruCtl ctl, int64 pageno)
void SlruDeleteSegment(SlruCtl ctl, int64 segno)
bool SlruScanDirectory(SlruCtl ctl, SlruScanCallback callback, void *data)
int SimpleLruReadPage(SlruCtl ctl, int64 pageno, bool write_ok, TransactionId xid)
int SlruSyncFileTag(SlruCtl ctl, const FileTag *ftag, char *path)
int SimpleLruZeroPage(SlruCtl ctl, int64 pageno)
void SimpleLruZeroAndWritePage(SlruCtl ctl, int64 pageno)
void SimpleLruTruncate(SlruCtl ctl, int64 cutoffPage)
Size SimpleLruShmemSize(int nslots, int nlsns)
bool check_slru_buffers(const char *name, int *newval)
static LWLock * SimpleLruGetBankLock(SlruCtl ctl, int64 pageno)
#define SlruPagePrecedesUnitTests(ctl, per_page)
void appendStringInfo(StringInfo str, const char *fmt,...)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
MultiXactId multiWrapLimit
MultiXactId multiStopLimit
MultiXactId multiWarnLimit
MultiXactId multiVacLimit
MultiXactOffset offsetStopLimit
MultiXactOffset nextOffset
MultiXactId oldestMultiXactId
MultiXactId perBackendXactIds[FLEXIBLE_ARRAY_MEMBER]
MultiXactOffset oldestOffset
MultiXactMember members[FLEXIBLE_ARRAY_MEMBER]
int64 earliestExistingPage
MultiXactMember members[FLEXIBLE_ARRAY_MEMBER]
MultiXactOffset startTruncMemb
MultiXactOffset endTruncMemb
MultiXactId startTruncOff
@ SYNC_HANDLER_MULTIXACT_MEMBER
@ SYNC_HANDLER_MULTIXACT_OFFSET
bool TransactionIdDidCommit(TransactionId transactionId)
#define TransactionIdEquals(id1, id2)
#define TransactionIdIsValid(xid)
static bool TransactionIdPrecedes(TransactionId id1, TransactionId id2)
ProcNumber TwoPhaseGetDummyProcNumber(FullTransactionId fxid, bool lock_held)
void RegisterTwoPhaseRecord(TwoPhaseRmgrId rmid, uint16 info, const void *data, uint32 len)
#define TWOPHASE_RM_MULTIXACT_ID
void AdvanceNextFullTransactionIdPastXid(TransactionId xid)
bool IsTransactionState(void)
bool TransactionIdIsCurrentTransactionId(TransactionId xid)
bool RecoveryInProgress(void)
void XLogFlush(XLogRecPtr record)
XLogRecPtr XLogSimpleInsertInt64(RmgrId rmid, uint8 info, int64 value)
XLogRecPtr XLogInsert(RmgrId rmid, uint8 info)
void XLogRegisterData(const void *data, uint32 len)
void XLogBeginInsert(void)
#define XLogRecGetInfo(decoder)
#define XLogRecGetData(decoder)
#define XLogRecGetXid(decoder)
#define XLogRecHasAnyBlockRefs(decoder)