|
PostgreSQL Source Code git master
|
#include "access/transam.h"#include "access/xlogreader.h"#include "lib/stringinfo.h"#include "storage/sync.h"

Go to the source code of this file.
Data Structures | |
| struct | MultiXactMember |
| struct | xl_multixact_create |
| struct | xl_multixact_truncate |
Macros | |
| #define | InvalidMultiXactId ((MultiXactId) 0) |
| #define | FirstMultiXactId ((MultiXactId) 1) |
| #define | MaxMultiXactId ((MultiXactId) 0xFFFFFFFF) |
| #define | MultiXactIdIsValid(multi) ((multi) != InvalidMultiXactId) |
| #define | MaxMultiXactStatus MultiXactStatusUpdate |
| #define | ISUPDATE_from_mxstatus(status) ((status) > MultiXactStatusForUpdate) |
| #define | XLOG_MULTIXACT_ZERO_OFF_PAGE 0x00 |
| #define | XLOG_MULTIXACT_ZERO_MEM_PAGE 0x10 |
| #define | XLOG_MULTIXACT_CREATE_ID 0x20 |
| #define | XLOG_MULTIXACT_TRUNCATE_ID 0x30 |
| #define | SizeOfMultiXactCreate (offsetof(xl_multixact_create, members)) |
| #define | SizeOfMultiXactTruncate (sizeof(xl_multixact_truncate)) |
Typedefs | |
| typedef struct MultiXactMember | MultiXactMember |
| typedef struct xl_multixact_create | xl_multixact_create |
| typedef struct xl_multixact_truncate | xl_multixact_truncate |
Enumerations | |
| enum | MultiXactStatus { MultiXactStatusForKeyShare = 0x00 , MultiXactStatusForShare = 0x01 , MultiXactStatusForNoKeyUpdate = 0x02 , MultiXactStatusForUpdate = 0x03 , MultiXactStatusNoKeyUpdate = 0x04 , MultiXactStatusUpdate = 0x05 } |
| #define FirstMultiXactId ((MultiXactId) 1) |
Definition at line 26 of file multixact.h.
| #define InvalidMultiXactId ((MultiXactId) 0) |
Definition at line 25 of file multixact.h.
| #define ISUPDATE_from_mxstatus | ( | status | ) | ((status) > MultiXactStatusForUpdate) |
Definition at line 51 of file multixact.h.
| #define MaxMultiXactId ((MultiXactId) 0xFFFFFFFF) |
Definition at line 27 of file multixact.h.
| #define MaxMultiXactStatus MultiXactStatusUpdate |
Definition at line 48 of file multixact.h.
| #define MultiXactIdIsValid | ( | multi | ) | ((multi) != InvalidMultiXactId) |
Definition at line 29 of file multixact.h.
| #define SizeOfMultiXactCreate (offsetof(xl_multixact_create, members)) |
Definition at line 80 of file multixact.h.
| #define SizeOfMultiXactTruncate (sizeof(xl_multixact_truncate)) |
Definition at line 93 of file multixact.h.
| #define XLOG_MULTIXACT_CREATE_ID 0x20 |
Definition at line 69 of file multixact.h.
| #define XLOG_MULTIXACT_TRUNCATE_ID 0x30 |
Definition at line 70 of file multixact.h.
| #define XLOG_MULTIXACT_ZERO_MEM_PAGE 0x10 |
Definition at line 68 of file multixact.h.
| #define XLOG_MULTIXACT_ZERO_OFF_PAGE 0x00 |
Definition at line 67 of file multixact.h.
| Enumerator | |
|---|---|
| MultiXactStatusForKeyShare | |
| MultiXactStatusForShare | |
| MultiXactStatusForNoKeyUpdate | |
| MultiXactStatusForUpdate | |
| MultiXactStatusNoKeyUpdate | |
| MultiXactStatusUpdate | |
Definition at line 36 of file multixact.h.
Definition at line 1617 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 1645 of file multixact.c.
References fb(), MultiXactIdIsValid, MyOldestMemberMXactIdSlot(), RegisterTwoPhaseRecord(), and TWOPHASE_RM_MULTIXACT_ID.
Referenced by PrepareTransaction().
Definition at line 1855 of file multixact.c.
References MultiXactMemberCtl, MultiXactOffsetCtl, and SimpleLruZeroAndWritePage().
Referenced by BootStrapXLOG().
Definition at line 2031 of file multixact.c.
References fb(), MultiXactMemberCtl, MultiXactOffsetCtl, and SimpleLruWriteAll().
Referenced by CheckPointGuts().
|
extern |
Definition at line 1161 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().
|
extern |
Definition at line 2538 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().
|
extern |
Definition at line 2370 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().
|
extern |
Definition at line 50 of file mxactdesc.c.
References appendStringInfo(), buf, fb(), i, out_member(), XLOG_MULTIXACT_CREATE_ID, XLOG_MULTIXACT_TRUNCATE_ID, XLOG_MULTIXACT_ZERO_MEM_PAGE, XLOG_MULTIXACT_ZERO_OFF_PAGE, XLogRecGetData, and XLogRecGetInfo.
Definition at line 83 of file mxactdesc.c.
References fb(), XLOG_MULTIXACT_CREATE_ID, XLOG_MULTIXACT_TRUNCATE_ID, XLOG_MULTIXACT_ZERO_MEM_PAGE, XLOG_MULTIXACT_ZERO_OFF_PAGE, and XLR_INFO_MASK.
|
extern |
Definition at line 2907 of file multixact.c.
References AdvanceNextFullTransactionIdPastXid(), Assert, DEBUG1, elog, fb(), i, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MultiXactAdvanceNextMXact(), MultiXactIdToOffsetPage(), MultiXactIdToOffsetSegment(), MultiXactMemberCtl, MultiXactOffsetCtl, MXOffsetToMemberSegment(), NextMultiXactId(), PANIC, PerformMembersTruncation(), PerformOffsetsTruncation(), pg_atomic_write_u64(), 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.
|
extern |
Definition at line 1744 of file multixact.c.
References fb(), len, and multixact_twophase_postcommit().
|
extern |
Definition at line 1729 of file multixact.c.
References Assert, fb(), InvalidMultiXactId, len, PreparedXactOldestMemberMXactIdSlot(), and TwoPhaseGetDummyProcNumber().
Referenced by multixact_twophase_postabort().
|
extern |
Definition at line 1708 of file multixact.c.
References Assert, fb(), len, PreparedXactOldestMemberMXactIdSlot(), and TwoPhaseGetDummyProcNumber().
|
extern |
Definition at line 2231 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().
|
extern |
Definition at line 2258 of file multixact.c.
References Assert, InRecovery, MultiXactIdPrecedes(), MultiXactState, MultiXactStateData::oldestMultiXactId, and SetMultiXactIdLimit().
Referenced by xlog_redo().
|
extern |
Definition at line 2009 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().
|
extern |
Definition at line 347 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().
|
extern |
Definition at line 704 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().
|
extern |
Definition at line 400 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().
|
extern |
Definition at line 511 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().
|
extern |
Definition at line 2857 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().
|
extern |
Definition at line 2871 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 585 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 2582 of file multixact.c.
References autovacuum_multixact_freeze_max_age, fb(), GetMultiXactInfo(), Min, MULTIXACT_MEMBER_HIGH_THRESHOLD, and MULTIXACT_MEMBER_LOW_THRESHOLD.
Referenced by do_autovacuum(), do_start_worker(), and vacuum_get_cutoffs().
Definition at line 3013 of file multixact.c.
References MultiXactMemberCtl, and SlruSyncFileTag().
Definition at line 3004 of file multixact.c.
References MultiXactOffsetCtl, and SlruSyncFileTag().
|
extern |
Definition at line 2055 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 1784 of file multixact.c.
References Assert, DEBUG2, debug_elog2, fb(), IsUnderPostmaster, MemSet, multixact_member_buffers, multixact_offset_buffers, MULTIXACT_OFFSETS_PER_PAGE, MultiXactMemberCtl, MultiXactMemberIoErrorDetail(), MultiXactMemberPagePrecedes(), MultiXactOffsetCtl, MultiXactOffsetIoErrorDetail(), MultiXactOffsetPagePrecedes(), MultiXactSharedStateShmemSize(), MultiXactState, NumMemberSlots, OldestMemberMXactId, OldestVisibleMXactId, MultiXactStateData::perBackendXactIds, ShmemInitStruct(), SimpleLruInit(), SlruPagePrecedesUnitTests, SYNC_HANDLER_MULTIXACT_MEMBER, and SYNC_HANDLER_MULTIXACT_OFFSET.
Referenced by CreateOrAttachShmemStructs().
Definition at line 1772 of file multixact.c.
References add_size(), multixact_member_buffers, multixact_offset_buffers, MultiXactSharedStateShmemSize(), and SimpleLruShmemSize().
Referenced by CalculateShmemSize().
|
extern |
Definition at line 1586 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().
|
extern |
Definition at line 1563 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().
|
extern |
Definition at line 1659 of file multixact.c.
References dclist_init(), fb(), InvalidMultiXactId, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MultiXactIdIsValid, MXactCache, MXactContext, MyOldestMemberMXactIdSlot(), MyOldestVisibleMXactIdSlot(), PreparedXactOldestMemberMXactIdSlot(), and TwoPhaseGetDummyProcNumber().
Referenced by PrepareTransaction().
|
extern |
Definition at line 685 of file multixact.c.
References fb(), LW_SHARED, LWLockAcquire(), LWLockRelease(), MultiXactState, next, MultiXactStateData::nextMXact, and MultiXactStateData::oldestMultiXactId.
Referenced by update_cached_mxid_range().
|
extern |
Definition at line 668 of file multixact.c.
References fb(), LW_SHARED, LWLockAcquire(), LWLockRelease(), MultiXactState, and MultiXactStateData::nextMXact.
Referenced by ATRewriteTables(), AutoVacWorkerMain(), do_start_worker(), mxid_age(), refresh_by_heap_swap(), vac_update_datfrozenxid(), vac_update_relstats(), vacuum_get_cutoffs(), and vacuum_xid_failsafe_check().
|
extern |
Definition at line 2077 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 1871 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 1896 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().
|
extern |
Definition at line 2670 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().