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 }
 

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 

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 2654 of file walsender.c.

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

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

2655 {
2656  WalSnd *walsnd = MyWalSnd;
2657 
2659 
2660  if (walsnd->state == state)
2661  return;
2662 
2663  SpinLockAcquire(&walsnd->mutex);
2664  walsnd->state = state;
2665  SpinLockRelease(&walsnd->mutex);
2666 }
slock_t mutex
bool am_walsender
Definition: walsender.c:106
#define SpinLockAcquire(lock)
Definition: spin.h:62
WalSndState state
#define SpinLockRelease(lock)
Definition: spin.h:64
WalSnd * MyWalSnd
Definition: walsender.c:103
#define Assert(condition)
Definition: c.h:671
Definition: regguts.h:298

Variable Documentation

Node* replication_parse_result