|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/htup_details.h"#include "access/xlog_internal.h"#include "access/xlogrecovery.h"#include "access/xlogutils.h"#include "funcapi.h"#include "replication/logical.h"#include "replication/slot.h"#include "replication/slotsync.h"#include "utils/builtins.h"#include "utils/guc.h"#include "utils/pg_lsn.h"
Go to the source code of this file.
Macros | |
| #define | PG_GET_REPLICATION_SLOTS_COLS 21 |
Variables | |
| static const char * | SlotSyncSkipReasonNames [] |
| #define PG_GET_REPLICATION_SLOTS_COLS 21 |
|
static |
Definition at line 620 of file slotfuncs.c.
References Assert(), ReplicationSlotPersistentData::catalog_xmin, CheckLogicalDecodingRequirements(), CheckSlotPermissions(), CheckSlotRequirements(), ReplicationSlotPersistentData::confirmed_flush, create_logical_replication_slot(), create_physical_replication_slot(), ReplicationSlot::data, ReplicationSlot::effective_catalog_xmin, ReplicationSlot::effective_xmin, elog, ereport, errcode(), errdetail(), errhint(), errmsg(), ERROR, get_call_result_type(), heap_form_tuple(), HeapTupleGetDatum(), i, ReplicationSlot::in_use, ReplicationSlotPersistentData::invalidated, LSNGetDatum(), LW_SHARED, LWLockAcquire(), LWLockRelease(), max_replication_slots, ReplicationSlot::mutex, MyReplicationSlot, ReplicationSlotPersistentData::name, NameGetDatum(), NameStr, ReplicationSlotPersistentData::persistency, PG_GETARG_BOOL, PG_GETARG_NAME, PG_NARGS, PG_RETURN_DATUM, plugin, ReplicationSlotPersistentData::plugin, ReplicationSlotCtlData::replication_slots, ReplicationSlotCtl, ReplicationSlotMarkDirty(), ReplicationSlotPersist(), ReplicationSlotRelease(), ReplicationSlotSave(), ReplicationSlotsComputeRequiredLSN(), ReplicationSlotsComputeRequiredXmin(), ReplicationSlotPersistentData::restart_lsn, RS_INVAL_NONE, RS_TEMPORARY, SlotIsLogical, SpinLockAcquire, SpinLockRelease, TYPEFUNC_COMPOSITE, values, wal_segment_size, XLByteToSeg, XLogGetLastRemovedSegno(), XLogRecPtrIsValid, and ReplicationSlotPersistentData::xmin.
Referenced by pg_copy_logical_replication_slot_a(), pg_copy_logical_replication_slot_b(), pg_copy_logical_replication_slot_c(), pg_copy_physical_replication_slot_a(), and pg_copy_physical_replication_slot_b().
|
static |
Definition at line 128 of file slotfuncs.c.
References Assert(), CreateInitDecodingContext(), DecodingContextFindStartpoint(), failover, FreeDecodingContext(), MyReplicationSlot, name, NIL, plugin, read_local_xlog_page(), ReplicationSlotCreate(), RS_EPHEMERAL, RS_TEMPORARY, two_phase, wal_segment_close(), wal_segment_open(), and XL_ROUTINE.
Referenced by copy_replication_slot(), and pg_create_logical_replication_slot().
|
static |
Definition at line 47 of file slotfuncs.c.
References Assert(), ReplicationSlot::data, MyReplicationSlot, name, ReplicationSlotCreate(), ReplicationSlotMarkDirty(), ReplicationSlotReserveWal(), ReplicationSlotSave(), ReplicationSlotPersistentData::restart_lsn, RS_PERSISTENT, RS_TEMPORARY, and XLogRecPtrIsValid.
Referenced by copy_replication_slot(), and pg_create_physical_replication_slot().
| Datum pg_copy_logical_replication_slot_a | ( | PG_FUNCTION_ARGS | ) |
Definition at line 877 of file slotfuncs.c.
References copy_replication_slot().
| Datum pg_copy_logical_replication_slot_b | ( | PG_FUNCTION_ARGS | ) |
Definition at line 883 of file slotfuncs.c.
References copy_replication_slot().
| Datum pg_copy_logical_replication_slot_c | ( | PG_FUNCTION_ARGS | ) |
Definition at line 889 of file slotfuncs.c.
References copy_replication_slot().
| Datum pg_copy_physical_replication_slot_a | ( | PG_FUNCTION_ARGS | ) |
Definition at line 895 of file slotfuncs.c.
References copy_replication_slot().
| Datum pg_copy_physical_replication_slot_b | ( | PG_FUNCTION_ARGS | ) |
Definition at line 901 of file slotfuncs.c.
References copy_replication_slot().
| Datum pg_create_logical_replication_slot | ( | PG_FUNCTION_ARGS | ) |
Definition at line 180 of file slotfuncs.c.
References CheckLogicalDecodingRequirements(), CheckSlotPermissions(), ReplicationSlotPersistentData::confirmed_flush, create_logical_replication_slot(), ReplicationSlot::data, elog, ERROR, failover, get_call_result_type(), heap_form_tuple(), HeapTupleGetDatum(), InvalidXLogRecPtr, LSNGetDatum(), MyReplicationSlot, name, ReplicationSlotPersistentData::name, NameGetDatum(), NameStr, PG_GETARG_BOOL, PG_GETARG_NAME, PG_RETURN_DATUM, plugin, ReplicationSlotPersist(), ReplicationSlotRelease(), two_phase, TYPEFUNC_COMPOSITE, and values.
| Datum pg_create_physical_replication_slot | ( | PG_FUNCTION_ARGS | ) |
Definition at line 76 of file slotfuncs.c.
References CheckSlotPermissions(), CheckSlotRequirements(), create_physical_replication_slot(), ReplicationSlot::data, elog, ERROR, get_call_result_type(), heap_form_tuple(), HeapTupleGetDatum(), InvalidXLogRecPtr, LSNGetDatum(), MyReplicationSlot, name, ReplicationSlotPersistentData::name, NameGetDatum(), NameStr, PG_GETARG_BOOL, PG_GETARG_NAME, PG_RETURN_DATUM, ReplicationSlotRelease(), ReplicationSlotPersistentData::restart_lsn, TYPEFUNC_COMPOSITE, and values.
| Datum pg_drop_replication_slot | ( | PG_FUNCTION_ARGS | ) |
Definition at line 229 of file slotfuncs.c.
References CheckSlotPermissions(), CheckSlotRequirements(), name, NameStr, PG_GETARG_NAME, PG_RETURN_VOID, and ReplicationSlotDrop().
| Datum pg_get_replication_slots | ( | PG_FUNCTION_ARGS | ) |
Definition at line 247 of file slotfuncs.c.
References ReplicationSlot::active_pid, Assert(), BoolGetDatum(), ReplicationSlotPersistentData::catalog_xmin, ReplicationSlotPersistentData::confirmed_flush, CStringGetTextDatum, ReplicationSlot::data, ReplicationSlotPersistentData::database, ReplicationSlotPersistentData::failover, GetSlotInvalidationCauseName(), GetWALAvailability(), GetXLogWriteRecPtr(), i, ReplicationSlot::in_use, ReplicationSlot::inactive_since, InitMaterializedSRF(), Int32GetDatum(), Int64GetDatum(), ReplicationSlotPersistentData::invalidated, InvalidOid, InvalidTransactionId, LSNGetDatum(), LW_SHARED, LWLockAcquire(), LWLockRelease(), Max, max_replication_slots, max_slot_wal_keep_size_mb, ReplicationSlot::mutex, ReplicationSlotPersistentData::name, NameGetDatum(), ObjectIdGetDatum(), ReplicationSlotPersistentData::persistency, PG_GET_REPLICATION_SLOTS_COLS, ReplicationSlotPersistentData::plugin, ReplicationSlotCtlData::replication_slots, ReplicationSlotCtl, ReplicationSlotPersistentData::restart_lsn, RS_INVAL_HORIZON, RS_INVAL_NONE, RS_INVAL_WAL_LEVEL, RS_TEMPORARY, ReturnSetInfo::setDesc, ReturnSetInfo::setResult, SlotIsPhysical, ReplicationSlot::slotsync_skip_reason, SlotSyncSkipReasonNames, SpinLockAcquire, SpinLockRelease, SS_SKIP_NONE, ReplicationSlotPersistentData::synced, TimestampTzGetDatum(), TransactionIdGetDatum(), tuplestore_putvalues(), ReplicationSlotPersistentData::two_phase, ReplicationSlotPersistentData::two_phase_at, values, wal_keep_size_mb, wal_segment_size, WALAVAIL_EXTENDED, WALAVAIL_INVALID_LSN, WALAVAIL_REMOVED, WALAVAIL_RESERVED, WALAVAIL_UNRESERVED, XLByteToSeg, XLogMBVarToSegs, XLogRecPtrIsValid, XLogSegNoOffsetToRecPtr, and ReplicationSlotPersistentData::xmin.
|
static |
Definition at line 517 of file slotfuncs.c.
References LogicalSlotAdvanceAndCheckSnapState().
Referenced by pg_replication_slot_advance().
|
static |
Definition at line 481 of file slotfuncs.c.
References Assert(), ReplicationSlot::data, ReplicationSlot::mutex, MyReplicationSlot, PhysicalWakeupLogicalWalSnd(), ReplicationSlotMarkDirty(), ReplicationSlotPersistentData::restart_lsn, SpinLockAcquire, SpinLockRelease, and XLogRecPtrIsValid.
Referenced by pg_replication_slot_advance().
| Datum pg_replication_slot_advance | ( | PG_FUNCTION_ARGS | ) |
Definition at line 526 of file slotfuncs.c.
References Assert(), CheckSlotPermissions(), ReplicationSlotPersistentData::confirmed_flush, ReplicationSlot::data, ReplicationSlotPersistentData::database, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, get_call_result_type(), GetFlushRecPtr(), GetXLogReplayRecPtr(), heap_form_tuple(), HeapTupleGetDatum(), LSN_FORMAT_ARGS, LSNGetDatum(), Min, MyReplicationSlot, ReplicationSlotPersistentData::name, NameGetDatum(), NameStr, OidIsValid, PG_GETARG_LSN, PG_GETARG_NAME, pg_logical_replication_slot_advance(), pg_physical_replication_slot_advance(), PG_RETURN_DATUM, RecoveryInProgress(), ReplicationSlotAcquire(), ReplicationSlotRelease(), ReplicationSlotsComputeRequiredLSN(), ReplicationSlotsComputeRequiredXmin(), ReplicationSlotPersistentData::restart_lsn, TYPEFUNC_COMPOSITE, values, and XLogRecPtrIsValid.
| Datum pg_sync_replication_slots | ( | PG_FUNCTION_ARGS | ) |
Definition at line 911 of file slotfuncs.c.
References appendStringInfo(), appendStringInfoString(), CheckAndGetDbnameFromConninfo(), CheckSlotPermissions(), cluster_name, StringInfoData::data, ereport, err(), errcode(), errmsg(), ERROR, initStringInfo(), load_file(), pfree(), PG_RETURN_VOID, PrimaryConnInfo, RecoveryInProgress(), SyncReplicationSlots(), ValidateSlotSyncParams(), walrcv_connect, walrcv_disconnect, and wrconn.
|
static |
Definition at line 30 of file slotfuncs.c.
Referenced by pg_get_replication_slots().