|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/xloginsert.h"#include "catalog/pg_control.h"#include "miscadmin.h"#include "replication/slot.h"#include "storage/ipc.h"#include "storage/lmgr.h"#include "storage/proc.h"#include "storage/procarray.h"#include "utils/injection_point.h"
Go to the source code of this file.
Data Structures | |
| struct | LogicalDecodingCtlData |
Typedefs | |
| typedef struct LogicalDecodingCtlData | LogicalDecodingCtlData |
Functions | |
| static void | update_xlog_logical_info (void) |
| static void | abort_logical_decoding_activation (int code, Datum arg) |
| static void | write_logical_decoding_status_update_record (bool status) |
| Size | LogicalDecodingCtlShmemSize (void) |
| void | LogicalDecodingCtlShmemInit (void) |
| void | StartupLogicalDecodingStatus (bool last_status) |
| void | InitializeProcessXLogLogicalInfo (void) |
| bool | ProcessBarrierUpdateXLogLogicalInfo (void) |
| bool | IsLogicalDecodingEnabled (void) |
| bool | IsXLogLogicalInfoEnabled (void) |
| void | AtEOXact_LogicalCtl (void) |
| void | EnsureLogicalDecodingEnabled (void) |
| void | EnableLogicalDecoding (void) |
| void | RequestDisableLogicalDecoding (void) |
| void | DisableLogicalDecodingIfNecessary (void) |
| void | DisableLogicalDecoding (void) |
| void | UpdateLogicalDecodingStatusEndOfRecovery (void) |
Variables | |
| static LogicalDecodingCtlData * | LogicalDecodingCtl = NULL |
| bool | XLogLogicalInfo = false |
| static bool | XLogLogicalInfoUpdatePending = false |
| typedef struct LogicalDecodingCtlData LogicalDecodingCtlData |
|
static |
Definition at line 265 of file logicalctl.c.
References Assert(), DEBUG1, elog, EmitProcSignalBarrier(), LogicalDecodingCtlData::logical_decoding_enabled, LogicalDecodingCtl, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MyReplicationSlot, PROCSIGNAL_BARRIER_UPDATE_XLOG_LOGICAL_INFO, and LogicalDecodingCtlData::xlog_logical_info.
Referenced by EnsureLogicalDecodingEnabled().
| void AtEOXact_LogicalCtl | ( | void | ) |
Definition at line 235 of file logicalctl.c.
References update_xlog_logical_info(), and XLogLogicalInfoUpdatePending.
Referenced by AbortTransaction(), CommitTransaction(), and PrepareTransaction().
| void DisableLogicalDecoding | ( | void | ) |
Definition at line 491 of file logicalctl.c.
References CheckLogicalSlotExists(), EmitProcSignalBarrier(), END_CRIT_SECTION, ereport, errmsg(), LOG, LogicalDecodingCtlData::logical_decoding_enabled, LogicalDecodingCtl, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), LogicalDecodingCtlData::pending_disable, PROCSIGNAL_BARRIER_UPDATE_XLOG_LOGICAL_INFO, RecoveryInProgress(), START_CRIT_SECTION, write_logical_decoding_status_update_record(), and LogicalDecodingCtlData::xlog_logical_info.
Referenced by DisableLogicalDecodingIfNecessary(), and xlog_redo().
| void DisableLogicalDecodingIfNecessary | ( | void | ) |
Definition at line 460 of file logicalctl.c.
References Assert(), DisableLogicalDecoding(), LogicalDecodingCtl, LW_SHARED, LWLockAcquire(), LWLockRelease(), MyReplicationSlot, LogicalDecodingCtlData::pending_disable, RecoveryInProgress(), wal_level, and WAL_LEVEL_REPLICA.
Referenced by CheckpointerMain().
| void EnableLogicalDecoding | ( | void | ) |
Definition at line 340 of file logicalctl.c.
References EmitProcSignalBarrier(), END_CRIT_SECTION, ereport, errmsg(), INJECTION_POINT, LOG, LogicalDecodingCtlData::logical_decoding_enabled, LogicalDecodingCtl, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), LogicalDecodingCtlData::pending_disable, PROCSIGNAL_BARRIER_UPDATE_XLOG_LOGICAL_INFO, RecoveryInProgress(), START_CRIT_SECTION, WaitForProcSignalBarrier(), write_logical_decoding_status_update_record(), and LogicalDecodingCtlData::xlog_logical_info.
Referenced by EnsureLogicalDecodingEnabled(), and xlog_redo().
| void EnsureLogicalDecodingEnabled | ( | void | ) |
Definition at line 305 of file logicalctl.c.
References abort_logical_decoding_activation(), Assert(), EnableLogicalDecoding(), IsLogicalDecodingEnabled(), MyReplicationSlot, PG_END_ENSURE_ERROR_CLEANUP, PG_ENSURE_ERROR_CLEANUP, RecoveryInProgress(), wal_level, WAL_LEVEL_LOGICAL, and WAL_LEVEL_REPLICA.
Referenced by create_logical_replication_slot(), and CreateReplicationSlot().
| void InitializeProcessXLogLogicalInfo | ( | void | ) |
Definition at line 176 of file logicalctl.c.
References update_xlog_logical_info().
Referenced by BaseInit().
| bool IsLogicalDecodingEnabled | ( | void | ) |
Definition at line 204 of file logicalctl.c.
References LogicalDecodingCtlData::logical_decoding_enabled, LogicalDecodingCtl, LW_SHARED, LWLockAcquire(), and LWLockRelease().
Referenced by CheckLogicalDecodingRequirements(), create_logical_replication_slot(), CreateCheckPoint(), CreateReplicationSlot(), EnsureLogicalDecodingEnabled(), LogStandbySnapshot(), ResolveRecoveryConflictWithSnapshot(), UpdateLogicalDecodingStatusEndOfRecovery(), and ValidateSlotSyncParams().
| bool IsXLogLogicalInfoEnabled | ( | void | ) |
Definition at line 220 of file logicalctl.c.
References LogicalDecodingCtl, LW_SHARED, LWLockAcquire(), LWLockRelease(), and LogicalDecodingCtlData::xlog_logical_info.
Referenced by show_effective_wal_level(), update_xlog_logical_info(), and UpdateLogicalDecodingStatusEndOfRecovery().
| void LogicalDecodingCtlShmemInit | ( | void | ) |
Definition at line 129 of file logicalctl.c.
References LogicalDecodingCtl, LogicalDecodingCtlShmemSize(), MemSet, and ShmemInitStruct().
Referenced by CreateOrAttachShmemStructs().
| Size LogicalDecodingCtlShmemSize | ( | void | ) |
Definition at line 123 of file logicalctl.c.
Referenced by CalculateShmemSize(), and LogicalDecodingCtlShmemInit().
| bool ProcessBarrierUpdateXLogLogicalInfo | ( | void | ) |
Definition at line 186 of file logicalctl.c.
References GetTopTransactionIdIfAny(), InvalidTransactionId, update_xlog_logical_info(), and XLogLogicalInfoUpdatePending.
Referenced by ProcessProcSignalBarrier().
| void RequestDisableLogicalDecoding | ( | void | ) |
Definition at line 433 of file logicalctl.c.
References DEBUG1, elog, LogicalDecodingCtl, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), LogicalDecodingCtlData::pending_disable, WakeupCheckpointer(), wal_level, and WAL_LEVEL_REPLICA.
Referenced by InvalidateObsoleteReplicationSlots(), ReplicationSlotCleanup(), ReplicationSlotDrop(), ReplicationSlotRelease(), and ReplicationSlotsDropDBSlots().
| void StartupLogicalDecodingStatus | ( | bool | last_status | ) |
Definition at line 146 of file logicalctl.c.
References LogicalDecodingCtlData::logical_decoding_enabled, LogicalDecodingCtl, wal_level, WAL_LEVEL_MINIMAL, and LogicalDecodingCtlData::xlog_logical_info.
Referenced by StartupXLOG().
|
inlinestatic |
Definition at line 166 of file logicalctl.c.
References IsXLogLogicalInfoEnabled(), and XLogLogicalInfo.
Referenced by AtEOXact_LogicalCtl(), InitializeProcessXLogLogicalInfo(), and ProcessBarrierUpdateXLogLogicalInfo().
| void UpdateLogicalDecodingStatusEndOfRecovery | ( | void | ) |
Definition at line 553 of file logicalctl.c.
References Assert(), CheckLogicalSlotExists(), DEBUG1, elog, EmitProcSignalBarrier(), INJECTION_POINT, IsLogicalDecodingEnabled(), IsUnderPostmaster, IsXLogLogicalInfoEnabled(), LogicalDecodingCtlData::logical_decoding_enabled, LogicalDecodingCtl, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), LogicalDecodingCtlData::pending_disable, PROCSIGNAL_BARRIER_UPDATE_XLOG_LOGICAL_INFO, RecoveryInProgress(), WaitForProcSignalBarrier(), wal_level, WAL_LEVEL_LOGICAL, WAL_LEVEL_MINIMAL, write_logical_decoding_status_update_record(), and LogicalDecodingCtlData::xlog_logical_info.
Referenced by StartupXLOG().
|
static |
Definition at line 250 of file logicalctl.c.
References XLOG_LOGICAL_DECODING_STATUS_CHANGE, XLogBeginInsert(), XLogFlush(), XLogInsert(), and XLogRegisterData().
Referenced by DisableLogicalDecoding(), EnableLogicalDecoding(), and UpdateLogicalDecodingStatusEndOfRecovery().
|
static |
Definition at line 98 of file logicalctl.c.
Referenced by abort_logical_decoding_activation(), DisableLogicalDecoding(), DisableLogicalDecodingIfNecessary(), EnableLogicalDecoding(), IsLogicalDecodingEnabled(), IsXLogLogicalInfoEnabled(), LogicalDecodingCtlShmemInit(), RequestDisableLogicalDecoding(), StartupLogicalDecodingStatus(), and UpdateLogicalDecodingStatusEndOfRecovery().
| bool XLogLogicalInfo = false |
Definition at line 107 of file logicalctl.c.
Referenced by update_xlog_logical_info().
|
static |
Definition at line 116 of file logicalctl.c.
Referenced by AtEOXact_LogicalCtl(), and ProcessBarrierUpdateXLogLogicalInfo().