Header And Logo

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

syncrep.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * syncrep.h
00004  *    Exports from replication/syncrep.c.
00005  *
00006  * Portions Copyright (c) 2010-2013, PostgreSQL Global Development Group
00007  *
00008  * IDENTIFICATION
00009  *      src/include/replication/syncrep.h
00010  *
00011  *-------------------------------------------------------------------------
00012  */
00013 #ifndef _SYNCREP_H
00014 #define _SYNCREP_H
00015 
00016 #include "access/xlogdefs.h"
00017 #include "utils/guc.h"
00018 
00019 #define SyncRepRequested() \
00020     (max_wal_senders > 0 && synchronous_commit > SYNCHRONOUS_COMMIT_LOCAL_FLUSH)
00021 
00022 /* SyncRepWaitMode */
00023 #define SYNC_REP_NO_WAIT        -1
00024 #define SYNC_REP_WAIT_WRITE     0
00025 #define SYNC_REP_WAIT_FLUSH     1
00026 
00027 #define NUM_SYNC_REP_WAIT_MODE  2
00028 
00029 /* syncRepState */
00030 #define SYNC_REP_NOT_WAITING        0
00031 #define SYNC_REP_WAITING            1
00032 #define SYNC_REP_WAIT_COMPLETE      2
00033 
00034 /* user-settable parameters for synchronous replication */
00035 extern char *SyncRepStandbyNames;
00036 
00037 /* called by user backend */
00038 extern void SyncRepWaitForLSN(XLogRecPtr XactCommitLSN);
00039 
00040 /* called at backend exit */
00041 extern void SyncRepCleanupAtProcExit(void);
00042 
00043 /* called by wal sender */
00044 extern void SyncRepInitConfig(void);
00045 extern void SyncRepReleaseWaiters(void);
00046 
00047 /* called by wal writer */
00048 extern void SyncRepUpdateSyncStandbysDefined(void);
00049 
00050 /* called by various procs */
00051 extern int  SyncRepWakeQueue(bool all, int mode);
00052 
00053 extern bool check_synchronous_standby_names(char **newval, void **extra, GucSource source);
00054 extern void assign_synchronous_commit(int newval, void *extra);
00055 
00056 #endif   /* _SYNCREP_H */