PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | ResourceOwnerDesc |
Macros | |
#define | RELEASE_PRIO_BUFFER_IOS 100 |
#define | RELEASE_PRIO_BUFFER_PINS 200 |
#define | RELEASE_PRIO_RELCACHE_REFS 300 |
#define | RELEASE_PRIO_DSMS 400 |
#define | RELEASE_PRIO_JIT_CONTEXTS 500 |
#define | RELEASE_PRIO_CRYPTOHASH_CONTEXTS 600 |
#define | RELEASE_PRIO_HMAC_CONTEXTS 700 |
#define | RELEASE_PRIO_CATCACHE_REFS 100 |
#define | RELEASE_PRIO_CATCACHE_LIST_REFS 200 |
#define | RELEASE_PRIO_PLANCACHE_REFS 300 |
#define | RELEASE_PRIO_TUPDESC_REFS 400 |
#define | RELEASE_PRIO_SNAPSHOT_REFS 500 |
#define | RELEASE_PRIO_FILES 600 |
#define | RELEASE_PRIO_WAITEVENTSETS 700 |
#define | RELEASE_PRIO_FIRST 1 |
#define | RELEASE_PRIO_LAST UINT32_MAX |
Typedefs | |
typedef struct ResourceOwnerData * | ResourceOwner |
typedef uint32 | ResourceReleasePriority |
typedef struct ResourceOwnerDesc | ResourceOwnerDesc |
typedef void(* | ResourceReleaseCallback) (ResourceReleasePhase phase, bool isCommit, bool isTopLevel, void *arg) |
Enumerations | |
enum | ResourceReleasePhase { RESOURCE_RELEASE_BEFORE_LOCKS = 1 , RESOURCE_RELEASE_LOCKS , RESOURCE_RELEASE_AFTER_LOCKS } |
#define RELEASE_PRIO_BUFFER_IOS 100 |
Definition at line 62 of file resowner.h.
#define RELEASE_PRIO_BUFFER_PINS 200 |
Definition at line 63 of file resowner.h.
#define RELEASE_PRIO_CATCACHE_LIST_REFS 200 |
Definition at line 72 of file resowner.h.
#define RELEASE_PRIO_CATCACHE_REFS 100 |
Definition at line 71 of file resowner.h.
#define RELEASE_PRIO_CRYPTOHASH_CONTEXTS 600 |
Definition at line 67 of file resowner.h.
#define RELEASE_PRIO_DSMS 400 |
Definition at line 65 of file resowner.h.
#define RELEASE_PRIO_FILES 600 |
Definition at line 76 of file resowner.h.
#define RELEASE_PRIO_FIRST 1 |
Definition at line 80 of file resowner.h.
#define RELEASE_PRIO_HMAC_CONTEXTS 700 |
Definition at line 68 of file resowner.h.
#define RELEASE_PRIO_JIT_CONTEXTS 500 |
Definition at line 66 of file resowner.h.
#define RELEASE_PRIO_LAST UINT32_MAX |
Definition at line 81 of file resowner.h.
#define RELEASE_PRIO_PLANCACHE_REFS 300 |
Definition at line 73 of file resowner.h.
#define RELEASE_PRIO_RELCACHE_REFS 300 |
Definition at line 64 of file resowner.h.
#define RELEASE_PRIO_SNAPSHOT_REFS 500 |
Definition at line 75 of file resowner.h.
#define RELEASE_PRIO_TUPDESC_REFS 400 |
Definition at line 74 of file resowner.h.
#define RELEASE_PRIO_WAITEVENTSETS 700 |
Definition at line 77 of file resowner.h.
typedef struct ResourceOwnerData* ResourceOwner |
Definition at line 27 of file resowner.h.
typedef struct ResourceOwnerDesc ResourceOwnerDesc |
typedef void(* ResourceReleaseCallback) (ResourceReleasePhase phase, bool isCommit, bool isTopLevel, void *arg) |
Definition at line 126 of file resowner.h.
typedef uint32 ResourceReleasePriority |
Definition at line 59 of file resowner.h.
enum ResourceReleasePhase |
Enumerator | |
---|---|
RESOURCE_RELEASE_BEFORE_LOCKS | |
RESOURCE_RELEASE_LOCKS | |
RESOURCE_RELEASE_AFTER_LOCKS |
Definition at line 52 of file resowner.h.
void CreateAuxProcessResourceOwner | ( | void | ) |
Definition at line 982 of file resowner.c.
References Assert, AuxProcessResourceOwner, CurrentResourceOwner, on_shmem_exit(), ReleaseAuxProcessResourcesCallback(), and ResourceOwnerCreate().
Referenced by AuxiliaryProcessMainCommon(), and InitPostgres().
void RegisterResourceReleaseCallback | ( | ResourceReleaseCallback | callback, |
void * | arg | ||
) |
Definition at line 944 of file resowner.c.
References ResourceReleaseCallbackItem::arg, arg, ResourceReleaseCallbackItem::callback, callback(), MemoryContextAlloc(), ResourceReleaseCallbackItem::next, ResourceRelease_callbacks, and TopMemoryContext.
void ReleaseAuxProcessResources | ( | bool | isCommit | ) |
Definition at line 1002 of file resowner.c.
References AuxProcessResourceOwner, ResourceOwnerData::releasing, RESOURCE_RELEASE_AFTER_LOCKS, RESOURCE_RELEASE_BEFORE_LOCKS, RESOURCE_RELEASE_LOCKS, ResourceOwnerRelease(), and ResourceOwnerData::sorted.
Referenced by BackgroundWriterMain(), CheckpointerMain(), InitPostgres(), perform_base_backup(), pgarch_archiveXlog(), ReleaseAuxProcessResourcesCallback(), UploadManifest(), WalSndErrorCleanup(), WalSummarizerMain(), and WalWriterMain().
ResourceOwner ResourceOwnerCreate | ( | ResourceOwner | parent, |
const char * | name | ||
) |
Definition at line 413 of file resowner.c.
References ResourceOwnerData::firstchild, MemoryContextAllocZero(), name, ResourceOwnerData::name, ResourceOwnerData::nextchild, ResourceOwnerData::parent, and TopMemoryContext.
Referenced by AtStart_ResourceOwner(), AtSubStart_ResourceOwner(), CreateAuxProcessResourceOwner(), CreatePortal(), plpgsql_call_handler(), plpgsql_create_econtext(), plpgsql_inline_handler(), test_dsa_resowners(), test_resowner_forget_between_phases(), test_resowner_leak(), test_resowner_many(), test_resowner_priorities(), and test_resowner_remember_between_phases().
void ResourceOwnerDelete | ( | ResourceOwner | owner | ) |
Definition at line 854 of file resowner.c.
References Assert, CurrentResourceOwner, ResourceOwnerData::firstchild, ResourceOwnerData::hash, MAX_RESOWNER_LOCKS, ResourceOwnerData::narr, ResourceOwnerData::nhash, ResourceOwnerData::nlocks, pfree(), and ResourceOwnerNewParent().
Referenced by CleanupSubTransaction(), CleanupTransaction(), CommitSubTransaction(), CommitTransaction(), plpgsql_call_handler(), plpgsql_inline_handler(), PortalDrop(), PrepareTransaction(), test_dsa_resowners(), test_resowner_leak(), test_resowner_many(), and test_resowner_priorities().
void ResourceOwnerEnlarge | ( | ResourceOwner | owner | ) |
Definition at line 442 of file resowner.c.
References ResourceOwnerData::arr, Assert, ResourceOwnerData::capacity, elog, ERROR, ResourceOwnerData::grow_at, ResourceOwnerData::hash, i, ResourceElem::item, ResourceElem::kind, MemoryContextAllocZero(), ResourceOwnerData::narr, ResourceOwnerData::nhash, pfree(), ResourceOwnerData::releasing, ResourceOwnerAddToHash(), RESOWNER_ARRAY_SIZE, RESOWNER_HASH_INIT_SIZE, RESOWNER_HASH_MAX_ITEMS, and TopMemoryContext.
Referenced by BufferAlloc(), CachedPlanAllowsSimpleValidityCheck(), CachedPlanIsSimplyValid(), CreateWaitEventSet(), dsm_create_descriptor(), dsm_unpin_mapping(), EvictUnpinnedBuffer(), ExtendBufferedRelLocal(), ExtendBufferedRelShared(), FlushDatabaseBuffers(), FlushRelationBuffers(), FlushRelationsAllBuffers(), GetCachedPlan(), GetLocalVictimBuffer(), GetVictimBuffer(), IncrBufferRefCount(), IncrTupleDescRefCount(), llvm_create_context(), LocalBufferAlloc(), OpenTemporaryFile(), PathNameCreateTemporaryFile(), PathNameOpenTemporaryFile(), pg_cryptohash_create(), pg_hmac_create(), px_find_cipher(), px_find_digest(), ReadRecentBuffer(), RegisterSnapshotOnOwner(), RelationIncrementReferenceCount(), RememberManyTestResources(), SearchCatCacheInternal(), SearchCatCacheList(), SearchCatCacheMiss(), StartBufferIO(), SyncOneBuffer(), test_resowner_forget_between_phases(), test_resowner_leak(), test_resowner_priorities(), and test_resowner_remember_between_phases().
void ResourceOwnerForget | ( | ResourceOwner | owner, |
Datum | value, | ||
const ResourceOwnerDesc * | kind | ||
) |
Definition at line 554 of file resowner.c.
References ResourceOwnerData::arr, Assert, ResourceOwnerData::capacity, DatumGetPointer(), elog, ERROR, ResourceOwnerData::hash, hash_resource_elem(), i, idx(), ResourceElem::item, ResourceElem::kind, ResourceOwnerData::name, ResourceOwnerDesc::name, ResourceOwnerData::narr, ResourceOwnerData::nhash, ResourceOwnerData::releasing, ResourceOwnerData::sorted, and value.
Referenced by ForgetManyTestResources(), ResourceOwnerForgetBuffer(), ResourceOwnerForgetBufferIO(), ResourceOwnerForgetCatCacheListRef(), ResourceOwnerForgetCatCacheRef(), ResourceOwnerForgetCryptoHash(), ResourceOwnerForgetDSM(), ResourceOwnerForgetFile(), ResourceOwnerForgetHMAC(), ResourceOwnerForgetJIT(), ResourceOwnerForgetOSSLCipher(), ResourceOwnerForgetOSSLDigest(), ResourceOwnerForgetPlanCacheRef(), ResourceOwnerForgetRelationRef(), ResourceOwnerForgetSnapshot(), ResourceOwnerForgetTupleDesc(), ResourceOwnerForgetWaitEventSet(), and test_resowner_forget_between_phases().
void ResourceOwnerForgetLock | ( | ResourceOwner | owner, |
struct LOCALLOCK * | locallock | ||
) |
Definition at line 1065 of file resowner.c.
References Assert, elog, ERROR, i, ResourceOwnerData::locks, MAX_RESOWNER_LOCKS, ResourceOwnerData::name, and ResourceOwnerData::nlocks.
Referenced by LockReassignOwner(), LockRelease(), LockReleaseAll(), ReleaseLockIfHeld(), and RemoveLocalLock().
ResourceOwner ResourceOwnerGetParent | ( | ResourceOwner | owner | ) |
Definition at line 888 of file resowner.c.
References ResourceOwnerData::parent.
Referenced by LockReassignCurrentOwner().
void ResourceOwnerNewParent | ( | ResourceOwner | owner, |
ResourceOwner | newparent | ||
) |
Definition at line 897 of file resowner.c.
References Assert, ResourceOwnerData::firstchild, ResourceOwnerData::nextchild, and ResourceOwnerData::parent.
Referenced by AtSubAbort_Portals(), AtSubCommit_Portals(), and ResourceOwnerDelete().
void ResourceOwnerRelease | ( | ResourceOwner | owner, |
ResourceReleasePhase | phase, | ||
bool | isCommit, | ||
bool | isTopLevel | ||
) |
Definition at line 648 of file resowner.c.
References elog, LOG, and ResourceOwnerReleaseInternal().
Referenced by AbortSubTransaction(), AbortTransaction(), CommitSubTransaction(), CommitTransaction(), PortalDrop(), PrepareTransaction(), ReleaseAuxProcessResources(), test_dsa_resowners(), test_resowner_forget_between_phases(), test_resowner_leak(), test_resowner_many(), test_resowner_priorities(), and test_resowner_remember_between_phases().
void ResourceOwnerReleaseAllOfKind | ( | ResourceOwner | owner, |
const ResourceOwnerDesc * | kind | ||
) |
Definition at line 801 of file resowner.c.
References ResourceOwnerData::arr, Assert, ResourceOwnerData::capacity, elog, ERROR, ResourceOwnerData::hash, i, ResourceElem::item, ResourceElem::kind, ResourceOwnerDesc::name, ResourceOwnerData::narr, ResourceOwnerData::nhash, ResourceOwnerDesc::ReleaseResource, ResourceOwnerData::releasing, ResourceOwnerData::sorted, and value.
Referenced by ReleaseAllPlanCacheRefsInOwner().
void ResourceOwnerRemember | ( | ResourceOwner | owner, |
Datum | value, | ||
const ResourceOwnerDesc * | kind | ||
) |
Definition at line 514 of file resowner.c.
References ResourceOwnerData::arr, Assert, elog, ERROR, idx(), ResourceElem::item, ResourceElem::kind, ResourceOwnerData::narr, ResourceOwnerDesc::release_phase, ResourceOwnerDesc::release_priority, ResourceOwnerData::releasing, RESOWNER_ARRAY_SIZE, ResourceOwnerData::sorted, and value.
Referenced by RememberManyTestResources(), ResourceOwnerRememberBuffer(), ResourceOwnerRememberBufferIO(), ResourceOwnerRememberCatCacheListRef(), ResourceOwnerRememberCatCacheRef(), ResourceOwnerRememberCryptoHash(), ResourceOwnerRememberDSM(), ResourceOwnerRememberFile(), ResourceOwnerRememberHMAC(), ResourceOwnerRememberJIT(), ResourceOwnerRememberOSSLCipher(), ResourceOwnerRememberOSSLDigest(), ResourceOwnerRememberPlanCacheRef(), ResourceOwnerRememberRelationRef(), ResourceOwnerRememberSnapshot(), ResourceOwnerRememberTupleDesc(), ResourceOwnerRememberWaitEventSet(), test_resowner_forget_between_phases(), test_resowner_leak(), test_resowner_priorities(), and test_resowner_remember_between_phases().
void ResourceOwnerRememberLock | ( | ResourceOwner | owner, |
struct LOCALLOCK * | locallock | ||
) |
Definition at line 1045 of file resowner.c.
References Assert, ResourceOwnerData::locks, MAX_RESOWNER_LOCKS, and ResourceOwnerData::nlocks.
Referenced by GrantLockLocal(), and LockReassignOwner().
void UnregisterResourceReleaseCallback | ( | ResourceReleaseCallback | callback, |
void * | arg | ||
) |
Definition at line 958 of file resowner.c.
References ResourceReleaseCallbackItem::arg, arg, ResourceReleaseCallbackItem::callback, callback(), ResourceReleaseCallbackItem::next, pfree(), and ResourceRelease_callbacks.
|
extern |
Definition at line 168 of file resowner.c.
Referenced by CreateAuxProcessResourceOwner(), perform_base_backup(), ReleaseAuxProcessResources(), ShutdownXLOG(), StartupXLOG(), and UploadManifest().
|
extern |
Definition at line 165 of file resowner.c.
Referenced by _SPI_execute_plan(), apply_spooled_messages(), AssignTransactionId(), AtAbort_ResourceOwner(), AtStart_ResourceOwner(), AtSubAbort_ResourceOwner(), AtSubStart_ResourceOwner(), attach_internal(), BufferAlloc(), CleanupSubTransaction(), CleanupTransaction(), close_lo_relation(), CommitSubTransaction(), CommitTransaction(), create_internal(), CreateAuxProcessResourceOwner(), DecrTupleDescRefCount(), dsm_create_descriptor(), dsm_unpin_mapping(), EvictUnpinnedBuffer(), exec_eval_simple_expr(), exec_init_tuple_store(), exec_simple_check_plan(), exec_stmt_block(), ExecAppendAsyncEventWait(), ExplainExecuteQuery(), ExtendBufferedRelLocal(), ExtendBufferedRelShared(), extendBufFile(), FlushDatabaseBuffers(), FlushRelationBuffers(), FlushRelationsAllBuffers(), get_segment_by_index(), GetCurrentFDWTuplestore(), GetLocalVictimBuffer(), GetVictimBuffer(), IncrBufferRefCount(), IncrTupleDescRefCount(), InitPostgres(), llvm_create_context(), LocalBufferAlloc(), lock_and_open_sequence(), LockAcquireExtended(), LockReassignCurrentOwner(), LockReassignOwner(), LockRelease(), LogicalSlotAdvanceAndCheckSnapState(), make_callstmt_target(), make_new_segment(), makeBufFileCommon(), MakeTransitionCaptureState(), open_lo_relation(), OpenTemporaryFile(), PathNameCreateTemporaryFile(), PathNameOpenTemporaryFile(), perform_base_backup(), PersistHoldablePortal(), pg_cryptohash_create(), pg_hmac_create(), pg_logical_slot_get_changes_guts(), PinBuffer(), PinBuffer_Locked(), PinLocalBuffer(), plperl_spi_exec(), plperl_spi_exec_prepared(), plperl_spi_fetchrow(), plperl_spi_prepare(), plperl_spi_query(), plperl_spi_query_prepared(), plpgsql_estate_setup(), pltcl_func_handler(), pltcl_init_tuple_store(), pltcl_returnnext(), pltcl_SPI_execute(), pltcl_SPI_execute_plan(), pltcl_SPI_prepare(), pltcl_subtrans_abort(), pltcl_subtrans_commit(), pltcl_subtransaction(), PLy_abort_open_subtransactions(), PLy_cursor_fetch(), PLy_cursor_iternext(), PLy_cursor_plan(), PLy_cursor_query(), PLy_spi_execute_plan(), PLy_spi_execute_query(), PLy_spi_prepare(), PLy_spi_subtransaction_abort(), PLy_spi_subtransaction_commit(), PLy_subtransaction_enter(), PLy_subtransaction_exit(), PopTransaction(), PortalCleanup(), PortalRun(), PortalRunFetch(), PortalStart(), PrepareTransaction(), px_find_cipher(), px_find_digest(), ReadRecentBuffer(), RegisterSnapshot(), RegisterTemporaryFile(), RelationDecrementReferenceCount(), RelationIncrementReferenceCount(), ReleaseCatCache(), ReleaseCatCacheList(), ReleaseCatCacheListWithOwner(), ReleaseCatCacheWithOwner(), ReleaseLockIfHeld(), ResourceOwnerDelete(), ResourceOwnerReleaseInternal(), SearchCatCacheInternal(), SearchCatCacheList(), SearchCatCacheMiss(), ShutdownXLOG(), SnapBuildClearExportedSnapshot(), SnapBuildExportSnapshot(), SPI_plan_get_cached_plan(), StartBufferIO(), StartupXLOG(), SyncOneBuffer(), TerminateBufferIO(), test_dsa_resowners(), test_resowner_forget_between_phases(), test_resowner_leak(), test_resowner_many(), test_resowner_priorities(), test_resowner_remember_between_phases(), tuplestore_begin_common(), tuplestore_puttuple_common(), UnpinBuffer(), UnpinLocalBuffer(), UnregisterSnapshot(), UploadManifest(), and WaitLatchOrSocket().
|
extern |
Definition at line 166 of file resowner.c.
Referenced by AtStart_ResourceOwner(), AtSubStart_ResourceOwner(), CleanupSubTransaction(), CleanupTransaction(), CommitSubTransaction(), CommitTransaction(), CreatePortal(), GetCurrentFDWTuplestore(), MakeTransitionCaptureState(), PopTransaction(), and PrepareTransaction().
|
extern |
Definition at line 167 of file resowner.c.
Referenced by AbortTransaction(), apply_spooled_messages(), AtAbort_ResourceOwner(), AtStart_ResourceOwner(), be_lo_open(), CleanupTransaction(), close_lo_relation(), closeLOfd(), CommitTransaction(), lock_and_open_sequence(), open_lo_relation(), plpgsql_create_econtext(), PortalRun(), PrepareTransaction(), and ResourceOwnerReleaseInternal().