PostgreSQL Source Code  git master
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)
 
bool replication_scanner_is_replication_command (void)
 

Variables

PGDLLIMPORT WalSndMyWalSnd
 
PGDLLIMPORT WalSndCtlDataWalSndCtl
 
PGDLLIMPORT Nodereplication_parse_result
 

Typedef Documentation

◆ WalSnd

typedef struct WalSnd WalSnd

◆ WalSndState

typedef enum WalSndState WalSndState

Enumeration Type Documentation

◆ WalSndState

Enumerator
WALSNDSTATE_STARTUP 
WALSNDSTATE_BACKUP 
WALSNDSTATE_CATCHUP 
WALSNDSTATE_STREAMING 
WALSNDSTATE_STOPPING 

Definition at line 22 of file walsender_private.h.

23 {
29 } WalSndState;
WalSndState
@ WALSNDSTATE_STREAMING
@ WALSNDSTATE_BACKUP
@ WALSNDSTATE_CATCHUP
@ WALSNDSTATE_STARTUP
@ WALSNDSTATE_STOPPING

Function Documentation

◆ replication_scanner_finish()

void replication_scanner_finish ( void  )

◆ replication_scanner_init()

void replication_scanner_init ( const char *  query_string)

◆ replication_scanner_is_replication_command()

bool replication_scanner_is_replication_command ( void  )

◆ replication_yyerror()

void replication_yyerror ( const char *  str)

◆ replication_yylex()

int replication_yylex ( void  )

◆ replication_yyparse()

int replication_yyparse ( void  )

◆ WalSndSetState()

void WalSndSetState ( WalSndState  state)

Definition at line 3405 of file walsender.c.

3406 {
3407  WalSnd *walsnd = MyWalSnd;
3408 
3410 
3411  if (walsnd->state == state)
3412  return;
3413 
3414  SpinLockAcquire(&walsnd->mutex);
3415  walsnd->state = state;
3416  SpinLockRelease(&walsnd->mutex);
3417 }
Assert(fmt[strlen(fmt) - 1] !='\n')
#define SpinLockRelease(lock)
Definition: spin.h:64
#define SpinLockAcquire(lock)
Definition: spin.h:62
slock_t mutex
WalSndState state
Definition: regguts.h:318
WalSnd * MyWalSnd
Definition: walsender.c:113
bool am_walsender
Definition: walsender.c:116

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

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

Variable Documentation

◆ MyWalSnd

◆ replication_parse_result

PGDLLIMPORT Node* replication_parse_result
extern

◆ WalSndCtl