PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
walsender_private.h File Reference
#include "access/xlog.h"
#include "nodes/nodes.h"
#include "replication/syncrep.h"
#include "storage/latch.h"
#include "storage/shmem.h"
#include "storage/spin.h"
Include dependency graph for walsender_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  WalSnd
 
struct  WalSndCtlData
 

Typedefs

typedef enum WalSndState WalSndState
 
typedef struct WalSnd WalSnd
 

Enumerations

enum  WalSndState {
  WALSNDSTATE_STARTUP = 0, WALSNDSTATE_BACKUP, WALSNDSTATE_CATCHUP, WALSNDSTATE_STREAMING,
  WALSNDSTATE_STOPPING
}
 

Functions

void WalSndSetState (WalSndState state)
 
int replication_yyparse (void)
 
int replication_yylex (void)
 
void replication_yyerror (const char *str) pg_attribute_noreturn()
 
void replication_scanner_init (const char *query_string)
 
void replication_scanner_finish (void)
 

Variables

WalSndMyWalSnd
 
WalSndCtlDataWalSndCtl
 
Nodereplication_parse_result
 

Typedef Documentation

Enumeration Type Documentation

Enumerator
WALSNDSTATE_STARTUP 
WALSNDSTATE_BACKUP 
WALSNDSTATE_CATCHUP 
WALSNDSTATE_STREAMING 
WALSNDSTATE_STOPPING 

Definition at line 22 of file walsender_private.h.

Function Documentation

void replication_scanner_finish ( void  )
void replication_scanner_init ( const char *  query_string)
void replication_yyerror ( const char *  str)
int replication_yylex ( void  )
int replication_yyparse ( void  )
void WalSndSetState ( WalSndState  state)

Definition at line 3091 of file walsender.c.

References am_walsender, Assert, WalSnd::mutex, MyWalSnd, SpinLockAcquire, SpinLockRelease, and WalSnd::state.

Referenced by exec_replication_command(), SendBaseBackup(), StartLogicalReplication(), StartReplication(), WalSndErrorCleanup(), WalSndLoop(), and XLogSendPhysical().

3092 {
3093  WalSnd *walsnd = MyWalSnd;
3094 
3096 
3097  if (walsnd->state == state)
3098  return;
3099 
3100  SpinLockAcquire(&walsnd->mutex);
3101  walsnd->state = state;
3102  SpinLockRelease(&walsnd->mutex);
3103 }
slock_t mutex
bool am_walsender
Definition: walsender.c:114
#define SpinLockAcquire(lock)
Definition: spin.h:62
WalSndState state
#define SpinLockRelease(lock)
Definition: spin.h:64
WalSnd * MyWalSnd
Definition: walsender.c:111
#define Assert(condition)
Definition: c.h:675
Definition: regguts.h:298

Variable Documentation

Node* replication_parse_result