PostgreSQL Source Code
git master
|
#include "access/xlogdefs.h"
Go to the source code of this file.
Data Structures | |
struct | SyncRepStandbyData |
struct | SyncRepConfigData |
Macros | |
#define | SyncRepRequested() (max_wal_senders > 0 && synchronous_commit > SYNCHRONOUS_COMMIT_LOCAL_FLUSH) |
#define | SYNC_REP_NO_WAIT (-1) |
#define | SYNC_REP_WAIT_WRITE 0 |
#define | SYNC_REP_WAIT_FLUSH 1 |
#define | SYNC_REP_WAIT_APPLY 2 |
#define | NUM_SYNC_REP_WAIT_MODE 3 |
#define | SYNC_REP_NOT_WAITING 0 |
#define | SYNC_REP_WAITING 1 |
#define | SYNC_REP_WAIT_COMPLETE 2 |
#define | SYNC_REP_PRIORITY 0 |
#define | SYNC_REP_QUORUM 1 |
Typedefs | |
typedef struct SyncRepStandbyData | SyncRepStandbyData |
typedef struct SyncRepConfigData | SyncRepConfigData |
Functions | |
void | SyncRepWaitForLSN (XLogRecPtr lsn, bool commit) |
void | SyncRepCleanupAtProcExit (void) |
void | SyncRepInitConfig (void) |
void | SyncRepReleaseWaiters (void) |
int | SyncRepGetCandidateStandbys (SyncRepStandbyData **standbys) |
void | SyncRepUpdateSyncStandbysDefined (void) |
int | syncrep_yyparse (void) |
int | syncrep_yylex (void) |
void | syncrep_yyerror (const char *str) |
void | syncrep_scanner_init (const char *str) |
void | syncrep_scanner_finish (void) |
Variables | |
PGDLLIMPORT SyncRepConfigData * | SyncRepConfig |
PGDLLIMPORT SyncRepConfigData * | syncrep_parse_result |
PGDLLIMPORT char * | syncrep_parse_error_msg |
PGDLLIMPORT char * | SyncRepStandbyNames |
#define SyncRepRequested | ( | ) | (max_wal_senders > 0 && synchronous_commit > SYNCHRONOUS_COMMIT_LOCAL_FLUSH) |
typedef struct SyncRepConfigData SyncRepConfigData |
typedef struct SyncRepStandbyData SyncRepStandbyData |
void syncrep_scanner_finish | ( | void | ) |
Referenced by check_synchronous_standby_names().
void syncrep_scanner_init | ( | const char * | str | ) |
Referenced by check_synchronous_standby_names().
void syncrep_yyerror | ( | const char * | str | ) |
int syncrep_yylex | ( | void | ) |
int syncrep_yyparse | ( | void | ) |
Referenced by check_synchronous_standby_names().
void SyncRepCleanupAtProcExit | ( | void | ) |
Definition at line 373 of file syncrep.c.
References dlist_delete_thoroughly(), dlist_node_is_detached(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MyProc, and PGPROC::syncRepLinks.
Referenced by ProcKill().
int SyncRepGetCandidateStandbys | ( | SyncRepStandbyData ** | standbys | ) |
Definition at line 711 of file syncrep.c.
References SyncRepStandbyData::apply, WalSnd::apply, SyncRepStandbyData::flush, WalSnd::flush, i, SyncRepStandbyData::is_me, max_wal_senders, WalSnd::mutex, MyWalSnd, SyncRepConfigData::num_sync, palloc(), SyncRepStandbyData::pid, WalSnd::pid, qsort, SpinLockAcquire, SpinLockRelease, standby_priority_comparator(), WalSnd::state, SYNC_REP_PRIORITY, SyncRepStandbyData::sync_standby_priority, WalSnd::sync_standby_priority, SyncRepConfigData::syncrep_method, SyncRepConfig, SyncRepStandbyData::walsnd_index, WalSndCtl, WalSndCtlData::walsnds, WALSNDSTATE_STOPPING, WALSNDSTATE_STREAMING, SyncRepStandbyData::write, WalSnd::write, and XLogRecPtrIsInvalid.
Referenced by pg_stat_get_wal_senders(), and SyncRepGetSyncRecPtr().
void SyncRepInitConfig | ( | void | ) |
Definition at line 402 of file syncrep.c.
References application_name, DEBUG1, ereport, errmsg_internal(), WalSnd::mutex, MyWalSnd, SpinLockAcquire, SpinLockRelease, WalSnd::sync_standby_priority, and SyncRepGetStandbyPriority().
Referenced by ProcessPendingWrites(), StartLogicalReplication(), StartReplication(), WalSndLoop(), and WalSndWaitForWal().
void SyncRepReleaseWaiters | ( | void | ) |
Definition at line 431 of file syncrep.c.
References announce_next_takeover, application_name, DEBUG3, elog, ereport, errmsg(), WalSnd::flush, LOG, WalSndCtlData::lsn, LSN_FORMAT_ARGS, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MyWalSnd, WalSnd::state, SYNC_REP_PRIORITY, SYNC_REP_WAIT_APPLY, SYNC_REP_WAIT_FLUSH, SYNC_REP_WAIT_WRITE, WalSnd::sync_standby_priority, SyncRepConfigData::syncrep_method, SyncRepConfig, SyncRepGetSyncRecPtr(), SyncRepWakeQueue(), WalSndCtl, WALSNDSTATE_STOPPING, WALSNDSTATE_STREAMING, and XLogRecPtrIsInvalid.
Referenced by ProcessStandbyReplyMessage().
void SyncRepUpdateSyncStandbysDefined | ( | void | ) |
Definition at line 921 of file syncrep.c.
References i, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), NUM_SYNC_REP_WAIT_MODE, WalSndCtlData::sync_standbys_defined, SyncRepWakeQueue(), SyncStandbysDefined, and WalSndCtl.
Referenced by UpdateSharedMemoryConfig().
void SyncRepWaitForLSN | ( | XLogRecPtr | lsn, |
bool | commit | ||
) |
Definition at line 148 of file syncrep.c.
References Assert, DestNone, dlist_node_is_detached(), ereport, errcode(), errdetail(), errmsg(), InterruptHoldoffCount, LSN_FORMAT_ARGS, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), Min, mode, MyLatch, MyProc, pg_read_barrier, ProcDiePending, QueryCancelPending, ResetLatch(), set_ps_display_remove_suffix(), set_ps_display_suffix(), sprintf, SYNC_REP_NOT_WAITING, SYNC_REP_WAIT_COMPLETE, SYNC_REP_WAIT_FLUSH, SYNC_REP_WAITING, WalSndCtlData::sync_standbys_defined, SyncRepCancelWait(), PGPROC::syncRepLinks, SyncRepQueueInsert(), SyncRepRequested, PGPROC::syncRepState, SyncRepWaitMode, update_process_title, WaitLatch(), PGPROC::waitLSN, WalSndCtl, WARNING, whereToSendOutput, WL_LATCH_SET, and WL_POSTMASTER_DEATH.
Referenced by EndPrepare(), RecordTransactionAbortPrepared(), RecordTransactionCommit(), and RecordTransactionCommitPrepared().
|
extern |
Referenced by check_synchronous_standby_names().
|
extern |
Referenced by check_synchronous_standby_names().
|
extern |
Definition at line 97 of file syncrep.c.
Referenced by assign_synchronous_standby_names(), pg_stat_get_wal_senders(), SyncRepGetCandidateStandbys(), SyncRepGetStandbyPriority(), SyncRepGetSyncRecPtr(), and SyncRepReleaseWaiters().
|
extern |