diff options
| author | Mason S | 2010-08-05 18:36:37 +0000 |
|---|---|---|
| committer | Pavan Deolasee | 2011-05-19 16:45:14 +0000 |
| commit | 3c1f6c7ef0230d22ef2580d0212901b013841d45 (patch) | |
| tree | 6f4c7770c2e6cca4768f023971c9463922b0fafd /src/include | |
| parent | 9624091e0a1dc23b8eb17c7cd168ff4f3e57b3ec (diff) | |
Added more handling to deal with data node connection failures.
This includes forcing the release of connections in an unexpected
state and bug fixes.
This was written by Andrei Martsinchyk, with some additional
handling added by Mason.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/pgxc/datanode.h | 5 | ||||
| -rw-r--r-- | src/include/pgxc/execRemote.h | 5 | ||||
| -rw-r--r-- | src/include/pgxc/poolmgr.h | 6 |
3 files changed, 9 insertions, 7 deletions
diff --git a/src/include/pgxc/datanode.h b/src/include/pgxc/datanode.h index ab95022b5f..849d84acea 100644 --- a/src/include/pgxc/datanode.h +++ b/src/include/pgxc/datanode.h @@ -50,6 +50,9 @@ struct data_node_handle /* Connection state */ char transaction_status; DNConnectionState state; +#ifdef DN_CONNECTION_DEBUG + bool have_row_desc; +#endif char *error; /* Output buffer */ char *outBuffer; @@ -86,7 +89,7 @@ extern int data_node_send_query(DataNodeHandle * handle, const char *query); extern int data_node_send_gxid(DataNodeHandle * handle, GlobalTransactionId gxid); extern int data_node_send_snapshot(DataNodeHandle * handle, Snapshot snapshot); -extern void data_node_receive(const int conn_count, +extern int data_node_receive(const int conn_count, DataNodeHandle ** connections, struct timeval * timeout); extern int data_node_read_data(DataNodeHandle * conn); extern int send_some(DataNodeHandle * handle, int len); diff --git a/src/include/pgxc/execRemote.h b/src/include/pgxc/execRemote.h index d99806a01b..e9b59ccbd9 100644 --- a/src/include/pgxc/execRemote.h +++ b/src/include/pgxc/execRemote.h @@ -62,7 +62,6 @@ typedef struct RemoteQueryState char errorCode[5]; /* error code to send back to client */ char *errorMessage; /* error message to send back to client */ bool query_Done; /* query has been sent down to data nodes */ - bool need_tran; /* auto commit on nodes after completion */ char *completionTag; /* completion tag to present to caller */ char *msg; /* last data row message */ int msglen; /* length of the data row message */ @@ -81,8 +80,8 @@ typedef struct RemoteQueryState /* Multinode Executor */ extern void DataNodeBegin(void); -extern int DataNodeCommit(CommandDest dest); -extern int DataNodeRollback(CommandDest dest); +extern void DataNodeCommit(void); +extern int DataNodeRollback(void); extern DataNodeHandle** DataNodeCopyBegin(const char *query, List *nodelist, Snapshot snapshot, bool is_from); extern int DataNodeCopyIn(char *data_row, int len, Exec_Nodes *exec_nodes, DataNodeHandle** copy_connections); diff --git a/src/include/pgxc/poolmgr.h b/src/include/pgxc/poolmgr.h index 2c9128e7c7..b7ac3aedf0 100644 --- a/src/include/pgxc/poolmgr.h +++ b/src/include/pgxc/poolmgr.h @@ -45,7 +45,7 @@ typedef struct char *connstr; int freeSize; /* available connections */ int size; /* total pool size */ - DataNodePoolSlot **slot; + DataNodePoolSlot **slot; } DataNodePool; /* All pools for specified database */ @@ -57,7 +57,7 @@ typedef struct databasepool struct databasepool *next; } DatabasePool; -/* Agent of client session (Pool Manager side) +/* Agent of client session (Pool Manager side) * Acts as a session manager, grouping connections together */ typedef struct @@ -125,6 +125,6 @@ extern void PoolManagerConnect(PoolHandle *handle, const char *database); extern int *PoolManagerGetConnections(List *nodelist); /* Retun connections back to the pool */ -extern void PoolManagerReleaseConnections(void); +extern void PoolManagerReleaseConnections(int ndisc, int* discard); #endif |
