126 "array length mismatch");
129#define ReplicationSlotOnDiskConstantSize \
130 offsetof(ReplicationSlotOnDisk, slotdata)
132#define ReplicationSlotOnDiskNotChecksummedSize \
133 offsetof(ReplicationSlotOnDisk, version)
135#define ReplicationSlotOnDiskChecksummedSize \
136 sizeof(ReplicationSlotOnDisk) - ReplicationSlotOnDiskNotChecksummedSize
138#define ReplicationSlotOnDiskV2Size \
139 sizeof(ReplicationSlotOnDisk) - ReplicationSlotOnDiskConstantSize
141#define SLOT_MAGIC 0x1051CA1
142#define SLOT_VERSION 5
231 LWTRANCHE_REPLICATION_SLOT_IO);
270 char *err_msg = NULL;
271 char *err_hint = NULL;
274 &err_code, &err_msg, &err_hint))
288 if (err_hint != NULL)
312 int *err_code,
char **err_msg,
char **err_hint)
316 if (strlen(
name) == 0)
318 *err_code = ERRCODE_INVALID_NAME;
319 *err_msg =
psprintf(
_(
"replication slot name \"%s\" is too short"),
name);
326 *err_code = ERRCODE_NAME_TOO_LONG;
327 *err_msg =
psprintf(
_(
"replication slot name \"%s\" is too long"),
name);
332 for (cp =
name; *cp; cp++)
334 if (!((*cp >=
'a' && *cp <=
'z')
335 || (*cp >=
'0' && *cp <=
'9')
338 *err_code = ERRCODE_INVALID_NAME;
339 *err_msg =
psprintf(
_(
"replication slot name \"%s\" contains invalid character"),
name);
340 *err_hint =
psprintf(
_(
"Replication slot names may only contain lower case letters, numbers, and the underscore character."));
347 *err_code = ERRCODE_RESERVED_NAME;
348 *err_msg =
psprintf(
_(
"replication slot name \"%s\" is reserved"),
name);
349 *err_hint =
psprintf(
_(
"The name \"%s\" is reserved for the conflict detection slot."),
412 errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
413 errmsg(
"cannot enable failover for a replication slot created on the standby"));
424 errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
425 errmsg(
"cannot enable failover for a temporary replication slot"));
450 errmsg(
"replication slot \"%s\" already exists",
name)));
451 if (!s->
in_use && slot == NULL)
459 (
errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
460 errmsg(
"all replication slots are in use"),
461 errhint(
"Free one or increase \"max_replication_slots\".")));
639 if (s == NULL || !s->
in_use)
644 (
errcode(ERRCODE_UNDEFINED_OBJECT),
645 errmsg(
"replication slot \"%s\" does not exist",
656 errcode(ERRCODE_UNDEFINED_OBJECT),
657 errmsg(
"cannot acquire replication slot \"%s\"",
name),
658 errdetail(
"The slot is reserved for conflict detection and can only be acquired by logical replication launcher."));
704 WAIT_EVENT_REPLICATION_SLOT_DROP);
710 (
errcode(ERRCODE_OBJECT_IN_USE),
711 errmsg(
"replication slot \"%s\" is active for PID %d",
727 errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
728 errmsg(
"can no longer access replication slot \"%s\"",
730 errdetail(
"This replication slot has been invalidated due to \"%s\".",
749 ?
errmsg(
"acquired logical replication slot \"%s\"",
751 :
errmsg(
"acquired physical replication slot \"%s\"",
766 char *slotname = NULL;
767 bool is_logical =
false;
836 ?
errmsg(
"released logical replication slot \"%s\"",
838 :
errmsg(
"released physical replication slot \"%s\"",
903 errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
904 errmsg(
"cannot drop replication slot \"%s\"",
name),
905 errdetail(
"This replication slot is being synchronized from the primary server."));
917 bool update_slot =
false;
926 errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
927 errmsg(
"cannot use %s with a physical replication slot",
928 "ALTER_REPLICATION_SLOT"));
938 errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
939 errmsg(
"cannot alter replication slot \"%s\"",
name),
940 errdetail(
"This replication slot is being synchronized from the primary server."));
948 errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
949 errmsg(
"cannot enable failover for a replication slot"
961 errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
962 errmsg(
"cannot enable failover for a temporary replication slot"));
1036 if (rename(path, tmppath) == 0)
1064 errmsg(
"could not rename file \"%s\" to \"%s\": %m",
1095 if (!
rmtree(tmppath,
true))
1097 (
errmsg(
"could not remove directory \"%s\"", tmppath)));
1211 agg_xmin = effective_xmin;
1217 agg_catalog_xmin = effective_catalog_xmin;
1274 restart_lsn > last_saved_restart_lsn)
1276 restart_lsn = last_saved_restart_lsn;
1282 restart_lsn < min_required))
1283 min_required = restart_lsn;
1354 restart_lsn > last_saved_restart_lsn)
1356 restart_lsn = last_saved_restart_lsn;
1364 restart_lsn < result)
1365 result = restart_lsn;
1386 *nslots = *nactive = 0;
1476 if (active_pid == 0)
1506 (
errcode(ERRCODE_OBJECT_IN_USE),
1507 errmsg(
"replication slot \"%s\" is active for PID %d",
1508 slotname, active_pid)));
1541 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1542 errmsg(
"replication slots can only be used if \"max_replication_slots\" > 0")));
1546 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1547 errmsg(
"replication slots can only be used if \"wal_level\" >= \"replica\"")));
1558 (
errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
1559 errmsg(
"permission denied to use replication slots"),
1560 errdetail(
"Only roles with the %s attribute may use replication slots.",
1655 long slot_idle_seconds)
1667 uint64 ex = oldestLSN - restart_lsn;
1670 ngettext(
"The slot's restart_lsn %X/%08X exceeds the limit by %" PRIu64
" byte.",
1671 "The slot's restart_lsn %X/%08X exceeds the limit by %" PRIu64
" bytes.",
1677 "max_slot_wal_keep_size");
1682 snapshotConflictHorizon);
1686 appendStringInfoString(&err_detail,
_(
"Logical decoding on standby requires \"wal_level\" >= \"logical\" on the primary server."));
1692 appendStringInfo(&err_detail,
_(
"The slot's idle time of %lds exceeds the configured \"%s\" duration of %ds."),
1693 slot_idle_seconds,
"idle_replication_slot_timeout",
1697 "idle_replication_slot_timeout");
1706 errmsg(
"terminating process %d to release replication slot \"%s\"",
1708 errmsg(
"invalidating obsolete replication slot \"%s\"",
1758 restart_lsn < oldestLSN)
1773 snapshotConflictHorizon))
1777 snapshotConflictHorizon))
1799#ifdef USE_INJECTION_POINTS
1802 *inactive_since = 0;
1843 int last_signaled_pid = 0;
1844 bool released_lock =
false;
1854 long slot_idle_secs = 0;
1890 snapshotConflictHorizon,
1916 if (active_pid == 0)
1933 *invalidated =
true;
1944 int slot_idle_usecs;
1950 if (active_pid != 0)
1960 released_lock =
true;
1974 if (last_signaled_pid != active_pid)
1977 slotname, restart_lsn,
1978 oldestLSN, snapshotConflictHorizon,
1986 (
void)
kill(active_pid, SIGTERM);
1988 last_signaled_pid = active_pid;
1993 WAIT_EVENT_REPLICATION_SLOT_DROP);
2022 released_lock =
true;
2030 slotname, restart_lsn,
2031 oldestLSN, snapshotConflictHorizon,
2041 return released_lock;
2070 bool invalidated =
false;
2095 snapshotConflictHorizon,
2128 bool last_saved_restart_lsn_updated =
false;
2130 elog(
DEBUG1,
"performing replication slot checkpoint");
2178 last_saved_restart_lsn_updated =
true;
2188 if (last_saved_restart_lsn_updated)
2199 DIR *replication_dir;
2200 struct dirent *replication_de;
2202 elog(
DEBUG1,
"starting up replication slots");
2211 if (strcmp(replication_de->
d_name,
".") == 0 ||
2212 strcmp(replication_de->
d_name,
"..") == 0)
2228 (
errmsg(
"could not remove directory \"%s\"",
2287 errmsg(
"could not create directory \"%s\": %m",
2296 if (rename(tmppath, path) != 0)
2299 errmsg(
"could not rename file \"%s\" to \"%s\": %m",
2329 was_dirty = slot->
dirty;
2342 sprintf(tmppath,
"%s/state.tmp", dir);
2343 sprintf(path,
"%s/state", dir);
2354 int save_errno = errno;
2360 errmsg(
"could not create file \"%s\": %m",
2383 if ((
write(
fd, &cp,
sizeof(cp))) !=
sizeof(cp))
2385 int save_errno = errno;
2393 errno = save_errno ? save_errno : ENOSPC;
2396 errmsg(
"could not write to file \"%s\": %m",
2406 int save_errno = errno;
2416 errmsg(
"could not fsync file \"%s\": %m",
2424 int save_errno = errno;
2432 errmsg(
"could not close file \"%s\": %m",
2438 if (rename(tmppath, path) != 0)
2440 int save_errno = errno;
2448 errmsg(
"could not rename file \"%s\" to \"%s\": %m",
2470 slot->
dirty =
false;
2489 bool restored =
false;
2498 sprintf(path,
"%s/state.tmp", slotdir);
2499 if (unlink(path) < 0 && errno != ENOENT)
2502 errmsg(
"could not remove file \"%s\": %m", path)));
2504 sprintf(path,
"%s/state", slotdir);
2506 elog(
DEBUG1,
"restoring replication slot from \"%s\"", path);
2518 errmsg(
"could not open file \"%s\": %m", path)));
2528 errmsg(
"could not fsync file \"%s\": %m",
2546 errmsg(
"could not read file \"%s\": %m", path)));
2550 errmsg(
"could not read file \"%s\": read %d of %zu",
2559 errmsg(
"replication slot file \"%s\" has wrong magic number: %u instead of %u",
2566 errmsg(
"replication slot file \"%s\" has unsupported version %u",
2573 errmsg(
"replication slot file \"%s\" has corrupted length %u",
2582 if (readBytes != cp.
length)
2587 errmsg(
"could not read file \"%s\": %m", path)));
2591 errmsg(
"could not read file \"%s\": read %d of %zu",
2598 errmsg(
"could not close file \"%s\": %m", path)));
2609 (
errmsg(
"checksum mismatch for replication slot file \"%s\": is %u, should be %u",
2618 if (!
rmtree(slotdir,
true))
2621 (
errmsg(
"could not remove directory \"%s\"",
2644 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
2645 errmsg(
"logical replication slot \"%s\" exists, but \"wal_level\" < \"logical\"",
2647 errhint(
"Change \"wal_level\" to be \"logical\" or higher.")));
2658 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
2659 errmsg(
"logical replication slot \"%s\" exists on the standby, but \"hot_standby\" = \"off\"",
2661 errhint(
"Change \"hot_standby\" to be \"on\".")));
2665 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
2666 errmsg(
"physical replication slot \"%s\" exists, but \"wal_level\" < \"replica\"",
2668 errhint(
"Change \"wal_level\" to be \"replica\" or higher.")));
2715 (
errmsg(
"too many replication slots active before shutdown"),
2716 errhint(
"Increase \"max_replication_slots\" and try again.")));
2776 char *err_msg = NULL;
2777 char *err_hint = NULL;
2780 &err_msg, &err_hint))
2784 if (err_hint != NULL)
2806 if ((*
newval)[0] ==
'\0')
2815 if (!ok || elemlist ==
NIL)
2825 size += strlen(slot_name) + 1;
2838 strcpy(ptr, slot_name);
2839 ptr += strlen(slot_name) + 1;
2870 const char *standby_slot_name;
2884 if (strcmp(standby_slot_name, slot_name) == 0)
2887 standby_slot_name += strlen(standby_slot_name) + 1;
2904 int caught_up_slot_num = 0;
2952 errcode(ERRCODE_INVALID_PARAMETER_VALUE),
2953 errmsg(
"replication slot \"%s\" specified in parameter \"%s\" does not exist",
2954 name,
"synchronized_standby_slots"),
2955 errdetail(
"Logical replication is waiting on the standby associated with replication slot \"%s\".",
2957 errhint(
"Create the replication slot \"%s\" or amend parameter \"%s\".",
2958 name,
"synchronized_standby_slots"));
2966 errcode(ERRCODE_INVALID_PARAMETER_VALUE),
2967 errmsg(
"cannot specify logical replication slot \"%s\" in parameter \"%s\"",
2968 name,
"synchronized_standby_slots"),
2969 errdetail(
"Logical replication is waiting for correction on replication slot \"%s\".",
2971 errhint(
"Remove the logical replication slot \"%s\" from parameter \"%s\".",
2972 name,
"synchronized_standby_slots"));
2986 errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
2987 errmsg(
"physical replication slot \"%s\" specified in parameter \"%s\" has been invalidated",
2988 name,
"synchronized_standby_slots"),
2989 errdetail(
"Logical replication is waiting on the standby associated with replication slot \"%s\".",
2991 errhint(
"Drop and recreate the replication slot \"%s\", or amend parameter \"%s\".",
2992 name,
"synchronized_standby_slots"));
3001 errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
3002 errmsg(
"replication slot \"%s\" specified in parameter \"%s\" does not have active_pid",
3003 name,
"synchronized_standby_slots"),
3004 errdetail(
"Logical replication is waiting on the standby associated with replication slot \"%s\".",
3006 errhint(
"Start the standby associated with the replication slot \"%s\", or amend parameter \"%s\".",
3007 name,
"synchronized_standby_slots"));
3013 Assert(restart_lsn >= wait_for_lsn);
3016 min_restart_lsn > restart_lsn)
3017 min_restart_lsn = restart_lsn;
3019 caught_up_slot_num++;
3081 WAIT_EVENT_WAIT_FOR_STANDBY_CONFIRMATION);
void TimestampDifference(TimestampTz start_time, TimestampTz stop_time, long *secs, int *microsecs)
bool TimestampDifferenceExceedsSeconds(TimestampTz start_time, TimestampTz stop_time, int threshold_sec)
TimestampTz GetCurrentTimestamp(void)
Datum now(PG_FUNCTION_ARGS)
#define ngettext(s, p, n)
#define FLEXIBLE_ARRAY_MEMBER
#define MemSet(start, val, len)
bool ConditionVariableCancelSleep(void)
bool ConditionVariableTimedSleep(ConditionVariable *cv, long timeout, uint32 wait_event_info)
void ConditionVariableBroadcast(ConditionVariable *cv)
void ConditionVariablePrepareToSleep(ConditionVariable *cv)
void ConditionVariableInit(ConditionVariable *cv)
void ConditionVariableSleep(ConditionVariable *cv, uint32 wait_event_info)
int errmsg_internal(const char *fmt,...)
int errdetail_internal(const char *fmt,...)
int errcode_for_file_access(void)
int errdetail(const char *fmt,...)
int errhint_internal(const char *fmt,...)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
int MakePGDirectory(const char *directoryName)
int CloseTransientFile(int fd)
void fsync_fname(const char *fname, bool isdir)
DIR * AllocateDir(const char *dirname)
struct dirent * ReadDir(DIR *dir, const char *dirname)
int OpenTransientFile(const char *fileName, int fileFlags)
PGFileType get_dirent_type(const char *path, const struct dirent *de, bool look_through_symlinks, int elevel)
void ProcessConfigFile(GucContext context)
void GUC_check_errcode(int sqlerrcode)
void * guc_malloc(int elevel, size_t size)
#define GUC_check_errdetail
#define GUC_check_errhint
Assert(PointerIsAligned(start, uint64))
#define IS_INJECTION_POINT_ATTACHED(name)
volatile sig_atomic_t ConfigReloadPending
void before_shmem_exit(pg_on_exit_callback function, Datum arg)
bool IsLogicalLauncher(void)
void list_free(List *list)
bool LWLockHeldByMe(LWLock *lock)
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
bool LWLockHeldByMeInMode(LWLock *lock, LWLockMode mode)
void LWLockRelease(LWLock *lock)
void LWLockInitialize(LWLock *lock, int tranche_id)
char * pstrdup(const char *in)
void pfree(void *pointer)
#define START_CRIT_SECTION()
#define CHECK_FOR_INTERRUPTS()
#define END_CRIT_SECTION()
BackendType MyBackendType
bool has_rolreplication(Oid roleid)
void namestrcpy(Name name, const char *str)
#define ERRCODE_DATA_CORRUPTED
#define COMP_CRC32C(crc, data, len)
#define EQ_CRC32C(c1, c2)
static int list_length(const List *l)
#define foreach_ptr(type, var, lst)
static rewind_source * source
void pgstat_create_replslot(ReplicationSlot *slot)
void pgstat_acquire_replslot(ReplicationSlot *slot)
void pgstat_drop_replslot(ReplicationSlot *slot)
static int fd(const char *x, int i)
void ProcArraySetReplicationSlotXmin(TransactionId xmin, TransactionId catalog_xmin, bool already_locked)
#define INVALID_PROC_NUMBER
int SendProcSignal(pid_t pid, ProcSignalReason reason, ProcNumber procNumber)
@ PROCSIG_RECOVERY_CONFLICT_LOGICALSLOT
char * psprintf(const char *fmt,...)
bool rmtree(const char *path, bool rmtopdir)
Size add_size(Size s1, Size s2)
Size mul_size(Size s1, Size s2)
void * ShmemInitStruct(const char *name, Size size, bool *foundPtr)
int ReplicationSlotIndex(ReplicationSlot *slot)
void ReplicationSlotAcquire(const char *name, bool nowait, bool error_if_invalid)
static const SlotInvalidationCauseMap SlotInvalidationCauses[]
char * synchronized_standby_slots
void assign_synchronized_standby_slots(const char *newval, void *extra)
#define ReplicationSlotOnDiskChecksummedSize
void CheckPointReplicationSlots(bool is_shutdown)
void ReplicationSlotCreate(const char *name, bool db_specific, ReplicationSlotPersistency persistency, bool two_phase, bool failover, bool synced)
int idle_replication_slot_timeout_secs
void ReplicationSlotDropAcquired(void)
void ReplicationSlotMarkDirty(void)
static ReplicationSlotInvalidationCause DetermineSlotInvalidationCause(uint32 possible_causes, ReplicationSlot *s, XLogRecPtr oldestLSN, Oid dboid, TransactionId snapshotConflictHorizon, TimestampTz *inactive_since, TimestampTz now)
void ReplicationSlotReserveWal(void)
bool ReplicationSlotsCountDBSlots(Oid dboid, int *nslots, int *nactive)
struct SlotInvalidationCauseMap SlotInvalidationCauseMap
static XLogRecPtr ss_oldest_flush_lsn
bool ReplicationSlotValidateNameInternal(const char *name, bool allow_reserved_name, int *err_code, char **err_msg, char **err_hint)
void ReplicationSlotsDropDBSlots(Oid dboid)
#define ReplicationSlotOnDiskNotChecksummedSize
XLogRecPtr ReplicationSlotsComputeLogicalRestartLSN(void)
ReplicationSlotInvalidationCause GetSlotInvalidationCause(const char *cause_name)
void ReplicationSlotsComputeRequiredXmin(bool already_locked)
static void RestoreSlotFromDisk(const char *name)
void ReplicationSlotPersist(void)
static void ReportSlotInvalidation(ReplicationSlotInvalidationCause cause, bool terminating, int pid, NameData slotname, XLogRecPtr restart_lsn, XLogRecPtr oldestLSN, TransactionId snapshotConflictHorizon, long slot_idle_seconds)
ReplicationSlot * MyReplicationSlot
static void SaveSlotToPath(ReplicationSlot *slot, const char *dir, int elevel)
void ReplicationSlotDrop(const char *name, bool nowait)
bool SlotExistsInSyncStandbySlots(const char *slot_name)
static bool validate_sync_standby_slots(char *rawname, List **elemlist)
void ReplicationSlotSave(void)
ReplicationSlot * SearchNamedReplicationSlot(const char *name, bool need_lock)
static void CreateSlotOnDisk(ReplicationSlot *slot)
#define ReplicationSlotOnDiskV2Size
void CheckSlotPermissions(void)
bool ReplicationSlotName(int index, Name name)
bool check_synchronized_standby_slots(char **newval, void **extra, GucSource source)
void ReplicationSlotsShmemInit(void)
bool ReplicationSlotValidateName(const char *name, bool allow_reserved_name, int elevel)
void ReplicationSlotAlter(const char *name, const bool *failover, const bool *two_phase)
void ReplicationSlotRelease(void)
int max_replication_slots
StaticAssertDecl(lengthof(SlotInvalidationCauses)==(RS_INVAL_MAX_CAUSES+1), "array length mismatch")
ReplicationSlotCtlData * ReplicationSlotCtl
struct ReplicationSlotOnDisk ReplicationSlotOnDisk
void WaitForStandbyConfirmation(XLogRecPtr wait_for_lsn)
bool StandbySlotsHaveCaughtup(XLogRecPtr wait_for_lsn, int elevel)
void ReplicationSlotsComputeRequiredLSN(void)
void ReplicationSlotCleanup(bool synced_only)
void ReplicationSlotInitialize(void)
static void ReplicationSlotDropPtr(ReplicationSlot *slot)
void StartupReplicationSlots(void)
static bool InvalidatePossiblyObsoleteSlot(uint32 possible_causes, ReplicationSlot *s, XLogRecPtr oldestLSN, Oid dboid, TransactionId snapshotConflictHorizon, bool *invalidated)
static bool CanInvalidateIdleSlot(ReplicationSlot *s)
void CheckSlotRequirements(void)
bool InvalidateObsoleteReplicationSlots(uint32 possible_causes, XLogSegNo oldestSegno, Oid dboid, TransactionId snapshotConflictHorizon)
static SyncStandbySlotsConfigData * synchronized_standby_slots_config
#define ReplicationSlotOnDiskConstantSize
Size ReplicationSlotsShmemSize(void)
const char * GetSlotInvalidationCauseName(ReplicationSlotInvalidationCause cause)
static void ReplicationSlotShmemExit(int code, Datum arg)
static bool IsSlotForConflictCheck(const char *name)
#define CONFLICT_DETECTION_SLOT
#define RS_INVAL_MAX_CAUSES
ReplicationSlotPersistency
#define SlotIsPhysical(slot)
ReplicationSlotInvalidationCause
#define SlotIsLogical(slot)
static void ReplicationSlotSetInactiveSince(ReplicationSlot *s, TimestampTz ts, bool acquire_lock)
bool IsSyncingReplicationSlots(void)
#define SpinLockInit(lock)
#define SpinLockRelease(lock)
#define SpinLockAcquire(lock)
XLogRecPtr LogStandbySnapshot(void)
#define ERRCODE_DUPLICATE_OBJECT
bool pg_str_endswith(const char *str, const char *end)
void appendStringInfo(StringInfo str, const char *fmt,...)
void appendStringInfoString(StringInfo str, const char *s)
void initStringInfo(StringInfo str)
ReplicationSlot replication_slots[1]
ReplicationSlotPersistentData slotdata
TransactionId catalog_xmin
XLogRecPtr confirmed_flush
ReplicationSlotPersistency persistency
ReplicationSlotInvalidationCause invalidated
XLogRecPtr candidate_xmin_lsn
TransactionId effective_catalog_xmin
XLogRecPtr candidate_restart_valid
XLogRecPtr last_saved_confirmed_flush
TransactionId effective_xmin
XLogRecPtr last_saved_restart_lsn
XLogRecPtr candidate_restart_lsn
LWLock io_in_progress_lock
ConditionVariable active_cv
TransactionId candidate_catalog_xmin
ReplicationSlotPersistentData data
TimestampTz inactive_since
ReplicationSlotInvalidationCause cause
char slot_names[FLEXIBLE_ARRAY_MEMBER]
ConditionVariable wal_confirm_rcv_cv
#define InvalidTransactionId
static bool TransactionIdPrecedesOrEquals(TransactionId id1, TransactionId id2)
#define TransactionIdIsValid(xid)
static bool TransactionIdPrecedes(TransactionId id1, TransactionId id2)
bool SplitIdentifierString(char *rawstring, char separator, List **namelist)
static void pgstat_report_wait_start(uint32 wait_event_info)
static void pgstat_report_wait_end(void)
bool log_replication_commands
WalSndCtlData * WalSndCtl
bool RecoveryInProgress(void)
XLogSegNo XLogGetLastRemovedSegno(void)
XLogRecPtr GetRedoRecPtr(void)
void XLogSetReplicationSlotMinimumLSN(XLogRecPtr lsn)
XLogRecPtr GetXLogInsertRecPtr(void)
void XLogFlush(XLogRecPtr record)
#define XLogSegNoOffsetToRecPtr(segno, offset, wal_segsz_bytes, dest)
#define XLByteToSeg(xlrp, logSegNo, wal_segsz_bytes)
#define LSN_FORMAT_ARGS(lsn)
#define XLogRecPtrIsInvalid(r)
#define InvalidXLogRecPtr
XLogRecPtr GetXLogReplayRecPtr(TimeLineID *replayTLI)