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

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

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

2903 {
2904  WalSnd *walsnd = MyWalSnd;
2905 
2907 
2908  if (walsnd->state == state)
2909  return;
2910 
2911  SpinLockAcquire(&walsnd->mutex);
2912  walsnd->state = state;
2913  SpinLockRelease(&walsnd->mutex);
2914 }
slock_t mutex
bool am_walsender
Definition: walsender.c:108
#define SpinLockAcquire(lock)
Definition: spin.h:62
WalSndState state
#define SpinLockRelease(lock)
Definition: spin.h:64
WalSnd * MyWalSnd
Definition: walsender.c:105
#define Assert(condition)
Definition: c.h:675
Definition: regguts.h:298

Variable Documentation

Node* replication_parse_result