Header And Logo

PostgreSQL
| The world's most advanced open source database.

Data Structures | Typedefs | Enumerations | Functions | Variables

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)
void replication_scanner_init (const char *query_string)
void replication_scanner_finish (void)

Variables

WalSndMyWalSnd
WalSndCtlDataWalSndCtl
Nodereplication_parse_result

Typedef Documentation

typedef struct WalSnd WalSnd
typedef enum WalSndState WalSndState

Enumeration Type Documentation

Enumerator:
WALSNDSTATE_STARTUP 
WALSNDSTATE_BACKUP 
WALSNDSTATE_CATCHUP 
WALSNDSTATE_STREAMING 

Definition at line 22 of file walsender_private.h.

{
    WALSNDSTATE_STARTUP = 0,
    WALSNDSTATE_BACKUP,
    WALSNDSTATE_CATCHUP,
    WALSNDSTATE_STREAMING
} WalSndState;


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

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

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

{
    /* use volatile pointer to prevent code rearrangement */
    volatile WalSnd *walsnd = MyWalSnd;

    Assert(am_walsender);

    if (walsnd->state == state)
        return;

    SpinLockAcquire(&walsnd->mutex);
    walsnd->state = state;
    SpinLockRelease(&walsnd->mutex);
}


Variable Documentation

Definition at line 88 of file walsender.c.

Referenced by SyncRepInitConfig(), and SyncRepReleaseWaiters().