diff options
| author | Pavan Deolasee | 2011-03-08 11:15:12 +0000 |
|---|---|---|
| committer | Pavan Deolasee | 2011-06-17 07:42:24 +0000 |
| commit | 246072c6301bf3e38331ee49e4ff9bd4bd42b9a4 (patch) | |
| tree | 780ed90ae933dec23ccfb94a82689910e2e80052 /src/include | |
| parent | 88a19b42f3b599927b74e0aef2e19b9161b3a7eb (diff) | |
First cut implementation of BARRIER for PITR and global consistent recovery
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/access/rmgr.h | 5 | ||||
| -rw-r--r-- | src/include/nodes/nodes.h | 3 | ||||
| -rw-r--r-- | src/include/nodes/parsenodes.h | 13 | ||||
| -rw-r--r-- | src/include/parser/kwlist.h | 3 | ||||
| -rw-r--r-- | src/include/pgxc/barrier.h | 40 | ||||
| -rw-r--r-- | src/include/pgxc/execRemote.h | 1 | ||||
| -rw-r--r-- | src/include/pgxc/pgxcnode.h | 1 | ||||
| -rw-r--r-- | src/include/storage/lwlock.h | 1 |
8 files changed, 67 insertions, 0 deletions
diff --git a/src/include/access/rmgr.h b/src/include/access/rmgr.h index 72ee757f70..8253fad69f 100644 --- a/src/include/access/rmgr.h +++ b/src/include/access/rmgr.h @@ -32,6 +32,11 @@ typedef uint8 RmgrId; #define RM_GIN_ID 13 #define RM_GIST_ID 14 #define RM_SEQ_ID 15 +#ifdef PGXC +#define RM_BARRIER_ID 16 +#define RM_MAX_ID RM_BARRIER_ID +#else #define RM_MAX_ID RM_SEQ_ID +#endif #endif /* RMGR_H */ diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h index 5f5b947888..f2d937f222 100644 --- a/src/include/nodes/nodes.h +++ b/src/include/nodes/nodes.h @@ -327,6 +327,9 @@ typedef enum NodeTag T_ConstraintsSetStmt, T_ReindexStmt, T_CheckPointStmt, +#ifdef PGXC + T_BarrierStmt, +#endif T_CreateSchemaStmt, T_AlterDatabaseStmt, T_AlterDatabaseSetStmt, diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 79497e23b6..7ba9208ebf 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -2292,6 +2292,19 @@ typedef struct VacuumStmt List *va_cols; /* list of column names, or NIL for all */ } VacuumStmt; +#ifdef PGXC +/* + * ---------------------- + * Barrier Statement + */ +typedef struct BarrierStmt +{ + NodeTag type; + const char *id; /* User supplied barrier id, if any */ +} BarrierStmt; + +#endif + /* ---------------------- * Explain Statement * diff --git a/src/include/parser/kwlist.h b/src/include/parser/kwlist.h index 0564bcb8bc..12afba71fa 100644 --- a/src/include/parser/kwlist.h +++ b/src/include/parser/kwlist.h @@ -52,6 +52,9 @@ PG_KEYWORD("asymmetric", ASYMMETRIC, RESERVED_KEYWORD) PG_KEYWORD("at", AT, UNRESERVED_KEYWORD) PG_KEYWORD("authorization", AUTHORIZATION, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("backward", BACKWARD, UNRESERVED_KEYWORD) +#ifdef PGXC +PG_KEYWORD("barrier", BARRIER, UNRESERVED_KEYWORD) +#endif PG_KEYWORD("before", BEFORE, UNRESERVED_KEYWORD) PG_KEYWORD("begin", BEGIN_P, UNRESERVED_KEYWORD) PG_KEYWORD("between", BETWEEN, COL_NAME_KEYWORD) diff --git a/src/include/pgxc/barrier.h b/src/include/pgxc/barrier.h new file mode 100644 index 0000000000..37b506731c --- /dev/null +++ b/src/include/pgxc/barrier.h @@ -0,0 +1,40 @@ +/*------------------------------------------------------------------------- + * + * barrier.h + * + * Definitions for the PITR barrier handling + * + * + * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group + * Portions Copyright (c) 2010-2011 Nippon Telegraph and Telephone Corporation + * + * IDENTIFICATION + * $$ + * + *------------------------------------------------------------------------- + */ + +#ifndef BARRIER_H +#define BARRIER_H + +#include "access/xlog.h" +#include "access/xlogdefs.h" + +#define CREATE_BARRIER_PREPARE 'P' +#define CREATE_BARRIER_EXECUTE 'X' +#define CREATE_BARRIER_END 'E' + +#define CREATE_BARRIER_PREPARE_DONE 'p' +#define CREATE_BARRIER_EXECUTE_DONE 'x' + +typedef struct xl_barrier +{ + char barrier_id[1]; /* variable length data follows */ +} xl_barrier; + +#define XLOG_BARRIER_CREATE 0x00 + +extern void RequestBarrier(const char *id, char *completionTag); +extern void barrier_redo(XLogRecPtr lsn, XLogRecord *record); +extern void barrier_desc(StringInfo buf, uint8 xl_info, char *rec); +#endif diff --git a/src/include/pgxc/execRemote.h b/src/include/pgxc/execRemote.h index fb9232fca1..076100b6f5 100644 --- a/src/include/pgxc/execRemote.h +++ b/src/include/pgxc/execRemote.h @@ -36,6 +36,7 @@ #define RESPONSE_TUPDESC 2 #define RESPONSE_DATAROW 3 #define RESPONSE_COPY 4 +#define RESPONSE_BARRIER_OK 5 typedef enum { diff --git a/src/include/pgxc/pgxcnode.h b/src/include/pgxc/pgxcnode.h index 76f131e10d..8f1eb54f1a 100644 --- a/src/include/pgxc/pgxcnode.h +++ b/src/include/pgxc/pgxcnode.h @@ -66,6 +66,7 @@ struct pgxc_node_handle #ifdef DN_CONNECTION_DEBUG bool have_row_desc; #endif + char *barrier_id; char *error; /* Output buffer */ char *outBuffer; diff --git a/src/include/storage/lwlock.h b/src/include/storage/lwlock.h index 26acb95186..5c88470681 100644 --- a/src/include/storage/lwlock.h +++ b/src/include/storage/lwlock.h @@ -69,6 +69,7 @@ typedef enum LWLockId SyncScanLock, #ifdef PGXC AnalyzeProcArrayLock, + BarrierLock, #endif RelationMappingLock, AsyncCtlLock, |
