|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/multixact.h"#include "access/multixact_internal.h"#include "access/slru.h"#include "access/twophase.h"#include "access/twophase_rmgr.h"#include "access/xlog.h"#include "access/xloginsert.h"#include "access/xlogutils.h"#include "miscadmin.h"#include "pg_trace.h"#include "pgstat.h"#include "postmaster/autovacuum.h"#include "storage/pmsignal.h"#include "storage/proc.h"#include "storage/procarray.h"#include "storage/subsystems.h"#include "utils/guc_hooks.h"#include "utils/injection_point.h"#include "utils/lsyscache.h"#include "utils/memutils.h"
Go to the source code of this file.
Data Structures | |
| struct | MultiXactStateData |
| struct | mXactCacheEnt |
| struct | MultiXactMemberSlruReadContext |
Macros | |
| #define | MULTIXACT_MEMBER_LOW_THRESHOLD UINT64CONST(2000000000) |
| #define | MULTIXACT_MEMBER_HIGH_THRESHOLD UINT64CONST(4000000000) |
| #define | MultiXactOffsetCtl (&MultiXactOffsetSlruDesc) |
| #define | MultiXactMemberCtl (&MultiXactMemberSlruDesc) |
| #define | NumMemberSlots (MaxBackends + max_prepared_xacts) |
| #define | NumVisibleSlots MaxBackends |
| #define | MAX_CACHE_ENTRIES 256 |
| #define | debug_elog2(a, b) |
| #define | debug_elog3(a, b, c) |
| #define | debug_elog4(a, b, c, d) |
| #define | debug_elog5(a, b, c, d, e) |
| #define | debug_elog6(a, b, c, d, e, f) |
Typedefs | |
| typedef struct MultiXactStateData | MultiXactStateData |
| typedef struct mXactCacheEnt | mXactCacheEnt |
| typedef struct MultiXactMemberSlruReadContext | MultiXactMemberSlruReadContext |
Definition at line 310 of file multixact.c.
| #define MAX_CACHE_ENTRIES 256 |
Definition at line 299 of file multixact.c.
| #define MULTIXACT_MEMBER_HIGH_THRESHOLD UINT64CONST(4000000000) |
Definition at line 100 of file multixact.c.
| #define MULTIXACT_MEMBER_LOW_THRESHOLD UINT64CONST(2000000000) |
Definition at line 99 of file multixact.c.
| #define MultiXactMemberCtl (&MultiXactMemberSlruDesc) |
Definition at line 126 of file multixact.c.
| #define MultiXactOffsetCtl (&MultiXactOffsetSlruDesc) |
Definition at line 125 of file multixact.c.
| #define NumMemberSlots (MaxBackends + max_prepared_xacts) |
Definition at line 221 of file multixact.c.
| #define NumVisibleSlots MaxBackends |
Definition at line 222 of file multixact.c.
| typedef struct mXactCacheEnt mXactCacheEnt |
Definition at line 1628 of file multixact.c.
References dclist_init(), fb(), InvalidMultiXactId, MXactCache, MXactContext, MyOldestMemberMXactIdSlot(), and MyOldestVisibleMXactIdSlot().
Referenced by AbortTransaction(), CommitTransaction(), and test_read_multixact().
Definition at line 1656 of file multixact.c.
References fb(), MultiXactIdIsValid, MyOldestMemberMXactIdSlot(), RegisterTwoPhaseRecord(), and TWOPHASE_RM_MULTIXACT_ID.
Referenced by PrepareTransaction().
Definition at line 1863 of file multixact.c.
References MultiXactMemberCtl, MultiXactOffsetCtl, and SimpleLruZeroAndWritePage().
Referenced by BootStrapXLOG().
Definition at line 1852 of file multixact.c.
References check_slru_buffers(), and newval.
Definition at line 1843 of file multixact.c.
References check_slru_buffers(), and newval.
Definition at line 2039 of file multixact.c.
References fb(), MultiXactMemberCtl, MultiXactOffsetCtl, and SimpleLruWriteAll().
Referenced by CheckPointGuts().
|
static |
Definition at line 2317 of file multixact.c.
References difference(), fb(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MULTIXACT_MEMBERS_PER_PAGE, MultiXactMemberCtl, MXOffsetToFlagsBitShift(), MXOffsetToFlagsOffset(), MXOffsetToMemberPage(), SimpleLruGetBankLock(), SimpleLruZeroPage(), XLOG_MULTIXACT_ZERO_MEM_PAGE, and XLogSimpleInsertInt64().
Referenced by GetNewMultiXactId().
|
static |
Definition at line 2283 of file multixact.c.
References fb(), FirstMultiXactId, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MultiXactIdToOffsetEntry(), MultiXactIdToOffsetPage(), MultiXactOffsetCtl, SimpleLruGetBankLock(), SimpleLruZeroPage(), XLOG_MULTIXACT_ZERO_OFF_PAGE, and XLogSimpleInsertInt64().
Referenced by GetNewMultiXactId().
|
static |
Definition at line 2503 of file multixact.c.
References Assert, fb(), MultiXactStateData::finishedStartup, LWLockRelease(), MultiXactIdToOffsetEntry(), MultiXactIdToOffsetPage(), MultiXactMemberCtl, MultiXactOffsetCtl, MultiXactState, result, SimpleLruDoesPhysicalPageExist(), SimpleLruGetBankLock(), SimpleLruReadPage_ReadOnly(), and SimpleLruWriteAll().
Referenced by SetOldestOffset(), and TruncateMultiXact().
| int GetMultiXactIdMembers | ( | MultiXactId | multi, |
| MultiXactMember ** | members, | ||
| bool | from_pgupgrade, | ||
| bool | isLockOnly | ||
| ) |
Definition at line 1172 of file multixact.c.
References Assert, DEBUG2, debug_elog2, debug_elog3, ereport, errcode(), ERRCODE_DATA_CORRUPTED, errmsg, ERROR, fb(), i, LW_EXCLUSIVE, LW_SHARED, LWLockAcquire(), LWLockRelease(), MultiXactIdIsValid, MultiXactIdPrecedes(), MultiXactIdSetOldestVisible(), MultiXactIdToOffsetEntry(), MultiXactIdToOffsetPage(), MultiXactMemberCtl, MultiXactOffsetCtl, MultiXactState, MXACT_MEMBER_XACT_BITMASK, mXactCacheGetById(), mXactCachePut(), mxid_to_string(), MXOffsetToFlagsBitShift(), MXOffsetToFlagsOffset(), MXOffsetToMemberOffset(), MXOffsetToMemberPage(), MyOldestVisibleMXactIdSlot(), NextMultiXactId(), MultiXactStateData::nextMXact, MultiXactStateData::oldestMultiXactId, palloc(), SimpleLruGetBankLock(), SimpleLruReadPage(), MultiXactMember::status, TransactionIdIsValid, and MultiXactMember::xid.
Referenced by Do_MultiXactIdWait(), DoesMultiXactIdConflict(), FreezeMultiXactId(), GetMultiXactIdHintBits(), heap_lock_tuple(), heap_lock_updated_tuple_rec(), heap_tuple_should_freeze(), MultiXactIdExpand(), MultiXactIdGetUpdateXid(), MultiXactIdIsRunning(), pg_get_multixact_members(), pgrowlocks(), and test_read_multixact().
| void GetMultiXactInfo | ( | uint32 * | multixacts, |
| MultiXactOffset * | nextOffset, | ||
| MultiXactId * | oldestMultiXactId, | ||
| MultiXactOffset * | oldestOffset | ||
| ) |
Definition at line 2546 of file multixact.c.
References fb(), LW_SHARED, LWLockAcquire(), LWLockRelease(), MultiXactState, MultiXactStateData::nextMXact, MultiXactStateData::nextOffset, MultiXactStateData::oldestMultiXactId, and MultiXactStateData::oldestOffset.
Referenced by MultiXactMemberFreezeThreshold(), and pg_get_multixact_stats().
|
static |
Definition at line 979 of file multixact.c.
References DEBUG2, debug_elog3, debug_elog4, elog, ereport, errcode(), errdetail(), errhint(), errmsg, errmsg_plural(), ERROR, ExtendMultiXactMember(), ExtendMultiXactOffset(), fb(), FirstMultiXactId, get_database_name(), IsUnderPostmaster, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MaxMultiXactId, MultiXactStateData::multiStopLimit, MultiXactStateData::multiVacLimit, MultiXactStateData::multiWarnLimit, MultiXactStateData::multiWrapLimit, MultiXactIdPrecedes(), MultiXactState, NextMultiXactId(), MultiXactStateData::nextMXact, MultiXactStateData::nextOffset, MultiXactStateData::oldestMultiXactDB, PMSIGNAL_START_AUTOVAC_LAUNCHER, RecoveryInProgress(), result, SendPostmasterSignal(), START_CRIT_SECTION, and WARNING.
Referenced by MultiXactIdCreateFromMembers().
| MultiXactId GetOldestMultiXactId | ( | void | ) |
Definition at line 2378 of file multixact.c.
References fb(), i, LW_SHARED, LWLockAcquire(), LWLockRelease(), MultiXactIdIsValid, MultiXactIdPrecedes(), MultiXactState, MultiXactStateData::nextMXact, NumMemberSlots, NumVisibleSlots, OldestMemberMXactId, and OldestVisibleMXactId.
Referenced by heapam_relation_set_new_filelocator(), vac_update_datfrozenxid(), and vacuum_get_cutoffs().
| void multixact_redo | ( | XLogReaderState * | record | ) |
Definition at line 2915 of file multixact.c.
References AdvanceNextFullTransactionIdPastXid(), Assert, DEBUG1, elog, fb(), i, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), memcpy(), MultiXactAdvanceNextMXact(), MultiXactIdToOffsetSegment(), MultiXactMemberCtl, MultiXactOffsetCtl, MXOffsetToMemberSegment(), NextMultiXactId(), PANIC, PerformMembersTruncation(), PerformOffsetsTruncation(), RecordNewMultiXact(), SetMultiXactIdLimit(), SimpleLruZeroAndWritePage(), SizeOfMultiXactTruncate, TransactionIdPrecedes(), XLOG_MULTIXACT_CREATE_ID, XLOG_MULTIXACT_TRUNCATE_ID, XLOG_MULTIXACT_ZERO_MEM_PAGE, XLOG_MULTIXACT_ZERO_OFF_PAGE, XLogRecGetData, XLogRecGetInfo, XLogRecGetXid, and XLogRecHasAnyBlockRefs.
| void multixact_twophase_postabort | ( | FullTransactionId | fxid, |
| uint16 | info, | ||
| void * | recdata, | ||
| uint32 | len | ||
| ) |
Definition at line 1755 of file multixact.c.
References fb(), len, and multixact_twophase_postcommit().
| void multixact_twophase_postcommit | ( | FullTransactionId | fxid, |
| uint16 | info, | ||
| void * | recdata, | ||
| uint32 | len | ||
| ) |
Definition at line 1740 of file multixact.c.
References Assert, fb(), InvalidMultiXactId, len, PreparedXactOldestMemberMXactIdSlot(), and TwoPhaseGetDummyProcNumber().
Referenced by multixact_twophase_postabort().
| void multixact_twophase_recover | ( | FullTransactionId | fxid, |
| uint16 | info, | ||
| void * | recdata, | ||
| uint32 | len | ||
| ) |
Definition at line 1719 of file multixact.c.
References Assert, fb(), len, PreparedXactOldestMemberMXactIdSlot(), and TwoPhaseGetDummyProcNumber().
| void MultiXactAdvanceNextMXact | ( | MultiXactId | minMulti, |
| MultiXactOffset | minMultiOffset | ||
| ) |
Definition at line 2239 of file multixact.c.
References Assert, DEBUG2, debug_elog3, fb(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MultiXactIdIsValid, MultiXactIdPrecedes(), MultiXactState, MultiXactStateData::nextMXact, and MultiXactStateData::nextOffset.
Referenced by multixact_redo(), and xlog_redo().
| void MultiXactAdvanceOldest | ( | MultiXactId | oldestMulti, |
| Oid | oldestMultiDB | ||
| ) |
Definition at line 2266 of file multixact.c.
References Assert, InRecovery, MultiXactIdPrecedes(), MultiXactState, MultiXactStateData::oldestMultiXactId, and SetMultiXactIdLimit().
Referenced by xlog_redo().
| void MultiXactGetCheckptMulti | ( | bool | is_shutdown, |
| MultiXactId * | nextMulti, | ||
| MultiXactOffset * | nextMultiOffset, | ||
| MultiXactId * | oldestMulti, | ||
| Oid * | oldestMultiDB | ||
| ) |
Definition at line 2017 of file multixact.c.
References DEBUG2, debug_elog6, fb(), LW_SHARED, LWLockAcquire(), LWLockRelease(), MultiXactState, MultiXactStateData::nextMXact, MultiXactStateData::nextOffset, MultiXactStateData::oldestMultiXactDB, and MultiXactStateData::oldestMultiXactId.
Referenced by CreateCheckPoint().
| MultiXactId MultiXactIdCreate | ( | TransactionId | xid1, |
| MultiXactStatus | status1, | ||
| TransactionId | xid2, | ||
| MultiXactStatus | status2 | ||
| ) |
Definition at line 358 of file multixact.c.
References Assert, DEBUG2, debug_elog3, fb(), MultiXactIdCreateFromMembers(), MultiXactIdIsValid, mxid_to_string(), MyOldestMemberMXactIdSlot(), MultiXactMember::status, TransactionIdEquals, TransactionIdIsValid, and MultiXactMember::xid.
Referenced by compute_new_xmax_infomask(), and test_create_multixact().
| MultiXactId MultiXactIdCreateFromMembers | ( | int | nmembers, |
| MultiXactMember * | members | ||
| ) |
Definition at line 715 of file multixact.c.
References DEBUG2, debug_elog2, debug_elog3, elog, END_CRIT_SECTION, ERROR, fb(), GetNewMultiXactId(), i, INJECTION_POINT_CACHED, INJECTION_POINT_LOAD, InvalidMultiXactId, ISUPDATE_from_mxstatus, MultiXactIdIsValid, mXactCacheGetBySet(), mXactCachePut(), mxid_to_string(), RecordNewMultiXact(), SizeOfMultiXactCreate, XLOG_MULTIXACT_CREATE_ID, XLogBeginInsert(), XLogInsert(), and XLogRegisterData().
Referenced by FreezeMultiXactId(), MultiXactIdCreate(), and MultiXactIdExpand().
| MultiXactId MultiXactIdExpand | ( | MultiXactId | multi, |
| TransactionId | xid, | ||
| MultiXactStatus | status | ||
| ) |
Definition at line 411 of file multixact.c.
References Assert, DEBUG2, debug_elog3, debug_elog4, debug_elog5, fb(), GetMultiXactIdMembers(), i, ISUPDATE_from_mxstatus, j, MultiXactIdCreateFromMembers(), MultiXactIdIsValid, mxstatus_to_string(), MyOldestMemberMXactIdSlot(), palloc_array, pfree(), MultiXactMember::status, TransactionIdDidCommit(), TransactionIdEquals, TransactionIdIsInProgress(), TransactionIdIsValid, and MultiXactMember::xid.
Referenced by compute_new_xmax_infomask().
| bool MultiXactIdIsRunning | ( | MultiXactId | multi, |
| bool | isLockOnly | ||
| ) |
Definition at line 522 of file multixact.c.
References DEBUG2, debug_elog2, debug_elog3, debug_elog4, fb(), GetMultiXactIdMembers(), i, pfree(), TransactionIdIsCurrentTransactionId(), and TransactionIdIsInProgress().
Referenced by compute_new_xmax_infomask(), FreezeMultiXactId(), HeapTupleSatisfiesUpdate(), and HeapTupleSatisfiesVacuumHorizon().
| bool MultiXactIdPrecedes | ( | MultiXactId | multi1, |
| MultiXactId | multi2 | ||
| ) |
Definition at line 2865 of file multixact.c.
References fb().
Referenced by check_mxid_in_range(), copy_table_data(), do_start_worker(), FreezeMultiXactId(), GetMultiXactIdMembers(), GetNewMultiXactId(), GetOldestMultiXactId(), heap_prepare_freeze_tuple(), heap_tuple_should_freeze(), heap_vacuum_eager_scan_setup(), MultiXactAdvanceNextMXact(), MultiXactAdvanceOldest(), MultiXactIdSetOldestVisible(), MultiXactOffsetPagePrecedes(), relation_needs_vacanalyze(), SetMultiXactIdLimit(), vac_truncate_clog(), vac_update_datfrozenxid(), vac_update_relstats(), vacuum_get_cutoffs(), and vacuum_xid_failsafe_check().
| bool MultiXactIdPrecedesOrEquals | ( | MultiXactId | multi1, |
| MultiXactId | multi2 | ||
| ) |
Definition at line 2879 of file multixact.c.
References fb().
Referenced by check_mxid_in_range(), heap_tuple_should_freeze(), heap_vacuum_rel(), TruncateMultiXact(), and vacuum_get_cutoffs().
Definition at line 596 of file multixact.c.
References DEBUG2, debug_elog4, fb(), LW_SHARED, LWLockAcquire(), LWLockRelease(), MultiXactIdIsValid, MultiXactState, MyOldestMemberMXactIdSlot(), MyProcNumber, and MultiXactStateData::nextMXact.
Referenced by heap_delete(), heap_lock_tuple(), heap_lock_updated_tuple(), heap_update(), and test_create_multixact().
Definition at line 646 of file multixact.c.
References DEBUG2, debug_elog4, fb(), i, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MultiXactIdIsValid, MultiXactIdPrecedes(), MultiXactState, MyOldestVisibleMXactIdSlot(), MyProcNumber, MultiXactStateData::nextMXact, NumMemberSlots, and OldestMemberMXactId.
Referenced by GetMultiXactIdMembers().
Definition at line 2590 of file multixact.c.
References autovacuum_multixact_freeze_max_age, fb(), GetMultiXactInfo(), Min, MULTIXACT_MEMBER_HIGH_THRESHOLD, MULTIXACT_MEMBER_LOW_THRESHOLD, and result.
Referenced by do_autovacuum(), do_start_worker(), pg_stat_get_autovacuum_scores(), and vacuum_get_cutoffs().
Definition at line 2846 of file multixact.c.
References errdetail(), fb(), MultiXactMemberSlruReadContext::multi, MultiXactIdIsValid, and MultiXactMemberSlruReadContext::offset.
Referenced by MultiXactShmemRequest().
Definition at line 2832 of file multixact.c.
References fb().
Referenced by MultiXactShmemRequest().
Definition at line 3011 of file multixact.c.
References MultiXactMemberCtl, and SlruSyncFileTag().
Definition at line 2838 of file multixact.c.
References errdetail(), and fb().
Referenced by MultiXactShmemRequest().
Definition at line 2811 of file multixact.c.
References fb(), FirstMultiXactId, MULTIXACT_OFFSETS_PER_PAGE, and MultiXactIdPrecedes().
Referenced by MultiXactShmemRequest().
Definition at line 3002 of file multixact.c.
References MultiXactOffsetCtl, and SlruSyncFileTag().
| void MultiXactSetNextMXact | ( | MultiXactId | nextMulti, |
| MultiXactOffset | nextMultiOffset | ||
| ) |
Definition at line 2063 of file multixact.c.
References Assert, DEBUG2, debug_elog4, fb(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MultiXactIdIsValid, MultiXactState, MultiXactStateData::nextMXact, and MultiXactStateData::nextOffset.
Referenced by BootStrapXLOG(), StartupXLOG(), and xlog_redo().
Definition at line 1832 of file multixact.c.
References MultiXactState, NumMemberSlots, OldestMemberMXactId, OldestVisibleMXactId, and MultiXactStateData::perBackendXactIds.
Definition at line 1817 of file multixact.c.
References MULTIXACT_OFFSETS_PER_PAGE, MultiXactOffsetCtl, MultiXactState, NumMemberSlots, OldestMemberMXactId, OldestVisibleMXactId, MultiXactStateData::perBackendXactIds, and SlruPagePrecedesUnitTests.
Definition at line 1766 of file multixact.c.
References add_size(), fb(), mul_size(), multixact_member_buffers, multixact_offset_buffers, MultiXactMemberIoErrorDetail(), MultiXactMemberPagePrecedes(), MultiXactMemberSlruDesc, MultiXactOffsetIoErrorDetail(), MultiXactOffsetPagePrecedes(), MultiXactOffsetSlruDesc, MultiXactState, name, NumMemberSlots, NumVisibleSlots, ShmemRequestStruct, SimpleLruRequest, SYNC_HANDLER_MULTIXACT_MEMBER, and SYNC_HANDLER_MULTIXACT_OFFSET.
|
static |
Definition at line 1482 of file multixact.c.
References dlist_iter::cur, dclist_container, dclist_foreach, dclist_move_head(), DEBUG2, debug_elog2, debug_elog3, mXactCacheEnt::members, memcpy(), mXactCacheEnt::multi, MXactCache, mxid_to_string(), mXactCacheEnt::nmembers, and palloc().
Referenced by GetMultiXactIdMembers().
|
static |
Definition at line 1439 of file multixact.c.
References dlist_iter::cur, dclist_container, dclist_foreach, dclist_move_head(), DEBUG2, debug_elog2, debug_elog3, fb(), InvalidMultiXactId, mXactCacheEnt::members, mXactCacheEnt::multi, MXactCache, mxactMemberComparator(), mxid_to_string(), mXactCacheEnt::nmembers, and qsort.
Referenced by MultiXactIdCreateFromMembers().
|
static |
Definition at line 1529 of file multixact.c.
References ALLOCSET_SMALL_SIZES, AllocSetContextCreate, dclist_container, dclist_count(), dclist_delete_from(), dclist_push_head(), dclist_tail_node(), DEBUG2, debug_elog2, debug_elog3, fb(), MAX_CACHE_ENTRIES, mXactCacheEnt::members, memcpy(), MemoryContextAlloc(), mXactCacheEnt::multi, MXactCache, MXactContext, mxactMemberComparator(), mxid_to_string(), mXactCacheEnt::nmembers, mXactCacheEnt::node, pfree(), qsort, and TopTransactionContext.
Referenced by GetMultiXactIdMembers(), and MultiXactIdCreateFromMembers().
Definition at line 1409 of file multixact.c.
References fb().
Referenced by mXactCacheGetBySet(), and mXactCachePut().
| char * mxid_to_string | ( | MultiXactId | multi, |
| int | nmembers, | ||
| MultiXactMember * | members | ||
| ) |
Definition at line 1597 of file multixact.c.
References appendStringInfo(), appendStringInfoChar(), buf, fb(), i, initStringInfo(), MemoryContextStrdup(), mxstatus_to_string(), pfree(), str, and TopMemoryContext.
Referenced by GetMultiXactIdMembers(), MultiXactIdCreate(), MultiXactIdCreateFromMembers(), mXactCacheGetById(), mXactCacheGetBySet(), and mXactCachePut().
| char * mxstatus_to_string | ( | MultiXactStatus | status | ) |
Definition at line 1574 of file multixact.c.
References elog, ERROR, MultiXactStatusForKeyShare, MultiXactStatusForNoKeyUpdate, MultiXactStatusForShare, MultiXactStatusForUpdate, MultiXactStatusNoKeyUpdate, and MultiXactStatusUpdate.
Referenced by MultiXactIdExpand(), mxid_to_string(), and pg_get_multixact_members().
|
inlinestatic |
Definition at line 240 of file multixact.c.
References Assert, MaxBackends, MyProcNumber, and OldestMemberMXactId.
Referenced by AtEOXact_MultiXact(), AtPrepare_MultiXact(), MultiXactIdCreate(), MultiXactIdExpand(), MultiXactIdSetOldestMember(), and PostPrepare_MultiXact().
|
inlinestatic |
Definition at line 268 of file multixact.c.
References Assert, MyProcNumber, NumVisibleSlots, and OldestVisibleMXactId.
Referenced by AtEOXact_MultiXact(), GetMultiXactIdMembers(), MultiXactIdSetOldestVisible(), and PostPrepare_MultiXact().
|
inlinestatic |
Definition at line 103 of file multixact.c.
References FirstMultiXactId, and MaxMultiXactId.
Referenced by GetMultiXactIdMembers(), GetNewMultiXactId(), multixact_redo(), and RecordNewMultiXact().
|
static |
Definition at line 2643 of file multixact.c.
References fb(), MultiXactMemberCtl, MXOffsetToMemberPage(), and SimpleLruTruncate().
Referenced by multixact_redo(), and TruncateMultiXact().
|
static |
Definition at line 2653 of file multixact.c.
References fb(), MultiXactIdToOffsetPage(), MultiXactOffsetCtl, PreviousMultiXactId(), and SimpleLruTruncate().
Referenced by multixact_redo(), and TruncateMultiXact().
| void PostPrepare_MultiXact | ( | FullTransactionId | fxid | ) |
Definition at line 1670 of file multixact.c.
References dclist_init(), fb(), InvalidMultiXactId, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MultiXactIdIsValid, MXactCache, MXactContext, MyOldestMemberMXactIdSlot(), MyOldestVisibleMXactIdSlot(), PreparedXactOldestMemberMXactIdSlot(), and TwoPhaseGetDummyProcNumber().
Referenced by PrepareTransaction().
|
inlinestatic |
Definition at line 252 of file multixact.c.
References Assert, fb(), FIRST_PREPARED_XACT_PROC_NUMBER, MaxBackends, NumMemberSlots, and OldestMemberMXactId.
Referenced by multixact_twophase_postcommit(), multixact_twophase_recover(), and PostPrepare_MultiXact().
|
inlinestatic |
Definition at line 109 of file multixact.c.
References FirstMultiXactId, and MaxMultiXactId.
Referenced by PerformOffsetsTruncation().
| void ReadMultiXactIdRange | ( | MultiXactId * | oldest, |
| MultiXactId * | next | ||
| ) |
Definition at line 696 of file multixact.c.
References fb(), LW_SHARED, LWLockAcquire(), LWLockRelease(), MultiXactState, next, MultiXactStateData::nextMXact, and MultiXactStateData::oldestMultiXactId.
Referenced by update_cached_mxid_range().
| MultiXactId ReadNextMultiXactId | ( | void | ) |
Definition at line 679 of file multixact.c.
References fb(), LW_SHARED, LWLockAcquire(), LWLockRelease(), MultiXactState, and MultiXactStateData::nextMXact.
Referenced by ATRewriteTables(), AutoVacWorkerMain(), do_start_worker(), mxid_age(), pg_stat_get_autovacuum_scores(), refresh_by_heap_swap(), vac_update_datfrozenxid(), vac_update_relstats(), vacuum_get_cutoffs(), and vacuum_xid_failsafe_check().
|
static |
Definition at line 816 of file multixact.c.
References Assert, fb(), FirstMultiXactId, i, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MultiXactIdToOffsetEntry(), MultiXactIdToOffsetPage(), MultiXactMemberCtl, MultiXactOffsetCtl, MultiXactStatusUpdate, MXACT_MEMBER_BITS_PER_XACT, MXOffsetToFlagsBitShift(), MXOffsetToFlagsOffset(), MXOffsetToMemberOffset(), MXOffsetToMemberPage(), next, NextMultiXactId(), SimpleLruGetBankLock(), SimpleLruReadPage(), MultiXactMember::status, and MultiXactMember::xid.
Referenced by multixact_redo(), and MultiXactIdCreateFromMembers().
| void SetMultiXactIdLimit | ( | MultiXactId | oldest_datminmxid, |
| Oid | oldest_datoid | ||
| ) |
Definition at line 2085 of file multixact.c.
References Assert, autovacuum_multixact_freeze_max_age, DEBUG1, ereport, errdetail(), errhint(), errmsg_internal(), errmsg_plural(), fb(), MultiXactStateData::finishedStartup, FirstMultiXactId, get_database_name(), InRecovery, IsTransactionState(), IsUnderPostmaster, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MaxMultiXactId, MultiXactStateData::multiStopLimit, MultiXactStateData::multiVacLimit, MultiXactStateData::multiWarnLimit, MultiXactStateData::multiWrapLimit, MultiXactIdIsValid, MultiXactIdPrecedes(), MultiXactState, MultiXactStateData::nextMXact, MultiXactStateData::oldestMultiXactDB, MultiXactStateData::oldestMultiXactId, PMSIGNAL_START_AUTOVAC_LAUNCHER, SendPostmasterSignal(), SetOldestOffset(), and WARNING.
Referenced by BootStrapXLOG(), multixact_redo(), MultiXactAdvanceOldest(), StartupXLOG(), TrimMultiXact(), and vac_truncate_clog().
Definition at line 2417 of file multixact.c.
References Assert, DEBUG1, ereport, errmsg, errmsg_internal(), fb(), find_multixact_start(), MultiXactStateData::finishedStartup, LOG, LW_EXCLUSIVE, LW_SHARED, LWLockAcquire(), LWLockRelease(), MultiXactState, MultiXactStateData::nextMXact, MultiXactStateData::nextOffset, MultiXactStateData::oldestMultiXactId, and MultiXactStateData::oldestOffset.
Referenced by SetMultiXactIdLimit().
Definition at line 1879 of file multixact.c.
References MultiXactIdToOffsetPage(), MultiXactMemberCtl, MultiXactOffsetCtl, MultiXactState, MXOffsetToMemberPage(), MultiXactStateData::nextMXact, MultiXactStateData::nextOffset, and pg_atomic_write_u64().
Referenced by StartupXLOG().
Definition at line 1904 of file multixact.c.
References fb(), MultiXactStateData::finishedStartup, FirstMultiXactId, InvalidMultiXactId, LW_EXCLUSIVE, LW_SHARED, LWLockAcquire(), LWLockRelease(), MemSet, MultiXactIdToOffsetEntry(), MultiXactIdToOffsetPage(), MultiXactMemberCtl, MultiXactOffsetCtl, MultiXactState, MXOffsetToFlagsOffset(), MXOffsetToMemberOffset(), MXOffsetToMemberPage(), MultiXactStateData::nextMXact, MultiXactStateData::nextOffset, MultiXactStateData::oldestMultiXactDB, MultiXactStateData::oldestMultiXactId, pg_atomic_write_u64(), SetMultiXactIdLimit(), SimpleLruGetBankLock(), SimpleLruReadPage(), and SimpleLruZeroPage().
Referenced by StartupXLOG().
| void TruncateMultiXact | ( | MultiXactId | newOldestMulti, |
| Oid | newOldestMultiDB | ||
| ) |
Definition at line 2678 of file multixact.c.
References Assert, DEBUG1, DELAY_CHKPT_START, PGPROC::delayChkptFlags, elog, END_CRIT_SECTION, ereport, errmsg, fb(), find_multixact_start(), MultiXactStateData::finishedStartup, LOG, LW_EXCLUSIVE, LW_SHARED, LWLockAcquire(), LWLockRelease(), MultiXactIdIsValid, MultiXactIdPrecedesOrEquals(), MultiXactIdToOffsetSegment(), MultiXactState, MXOffsetToMemberSegment(), MyProc, MultiXactStateData::nextMXact, MultiXactStateData::nextOffset, MultiXactStateData::oldestMultiXactDB, MultiXactStateData::oldestMultiXactId, MultiXactStateData::oldestOffset, PerformMembersTruncation(), PerformOffsetsTruncation(), RecoveryInProgress(), START_CRIT_SECTION, and WriteMTruncateXlogRec().
Referenced by vac_truncate_clog().
|
static |
Definition at line 2894 of file multixact.c.
References fb(), xl_multixact_truncate::oldestMultiDB, SizeOfMultiXactTruncate, XLOG_MULTIXACT_TRUNCATE_ID, XLogBeginInsert(), XLogFlush(), XLogInsert(), and XLogRegisterData().
Referenced by TruncateMultiXact().
|
static |
Definition at line 123 of file multixact.c.
Referenced by MultiXactShmemRequest().
|
static |
Definition at line 122 of file multixact.c.
Referenced by MultiXactShmemRequest().
| const ShmemCallbacks MultiXactShmemCallbacks |
Definition at line 233 of file multixact.c.
|
static |
Definition at line 225 of file multixact.c.
Referenced by find_multixact_start(), GetMultiXactIdMembers(), GetMultiXactInfo(), GetNewMultiXactId(), GetOldestMultiXactId(), MultiXactAdvanceNextMXact(), MultiXactAdvanceOldest(), MultiXactGetCheckptMulti(), MultiXactIdSetOldestMember(), MultiXactIdSetOldestVisible(), MultiXactSetNextMXact(), MultiXactShmemAttach(), MultiXactShmemInit(), MultiXactShmemRequest(), ReadMultiXactIdRange(), ReadNextMultiXactId(), SetMultiXactIdLimit(), SetOldestOffset(), StartupMultiXact(), TrimMultiXact(), and TruncateMultiXact().
|
static |
Definition at line 300 of file multixact.c.
Referenced by AtEOXact_MultiXact(), mXactCacheGetById(), mXactCacheGetBySet(), mXactCachePut(), and PostPrepare_MultiXact().
|
static |
Definition at line 301 of file multixact.c.
Referenced by AtEOXact_MultiXact(), mXactCachePut(), and PostPrepare_MultiXact().
|
static |
Definition at line 226 of file multixact.c.
Referenced by GetOldestMultiXactId(), MultiXactIdSetOldestVisible(), MultiXactShmemAttach(), MultiXactShmemInit(), MyOldestMemberMXactIdSlot(), and PreparedXactOldestMemberMXactIdSlot().
|
static |
Definition at line 227 of file multixact.c.
Referenced by GetOldestMultiXactId(), MultiXactShmemAttach(), MultiXactShmemInit(), and MyOldestVisibleMXactIdSlot().