summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorMason Sharp2010-09-06 23:54:53 +0000
committerPavan Deolasee2011-05-19 16:45:16 +0000
commit090f968136933eedf17b769fb0ff75e155851ada (patch)
tree512d1d977665a95682c9ae2578e3c89f470a9880 /src/include
parentd1d249f226e10fcb28640b54bef16376aa270adc (diff)
Improved error handling.
The primary focus is to better handle the case of a stopped or crashed data node on the coordinator. Also, before a rollback make sure connections are clean. If there was an error, tell the pooler to destroy the connections instead of returning them to the pools, even the data node connections that did not have an error but are involved in the statement. This is becaue there may be some remaining messages buffered or in transit, and could affect subsequent requests.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/pgxc/datanode.h7
-rw-r--r--src/include/pgxc/execRemote.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/src/include/pgxc/datanode.h b/src/include/pgxc/datanode.h
index 4202e2e942..4039c458fd 100644
--- a/src/include/pgxc/datanode.h
+++ b/src/include/pgxc/datanode.h
@@ -23,6 +23,9 @@
#include "utils/snapshot.h"
#include <unistd.h>
+#define NO_SOCKET -1
+
+
/* Connection to data node maintained by Pool Manager */
typedef struct PGconn NODE_CONNECTION;
@@ -80,8 +83,9 @@ extern int DataNodeConnClean(NODE_CONNECTION * conn);
extern void DataNodeCleanAndRelease(int code, Datum arg);
extern DataNodeHandle **get_handles(List *nodelist);
-extern void release_handles(void);
+extern void release_handles(bool force_drop);
extern int get_transaction_nodes(DataNodeHandle ** connections);
+extern int get_active_nodes(DataNodeHandle ** connections);
extern int ensure_in_buffer_capacity(size_t bytes_needed, DataNodeHandle * handle);
extern int ensure_out_buffer_capacity(size_t bytes_needed, DataNodeHandle * handle);
@@ -100,5 +104,6 @@ extern int data_node_flush(DataNodeHandle *handle);
extern char get_message(DataNodeHandle *conn, int *len, char **msg);
extern void add_error_message(DataNodeHandle * handle, const char *message);
+extern void clear_socket_data (DataNodeHandle *conn);
#endif
diff --git a/src/include/pgxc/execRemote.h b/src/include/pgxc/execRemote.h
index 143c8faae9..fbc4db0d19 100644
--- a/src/include/pgxc/execRemote.h
+++ b/src/include/pgxc/execRemote.h
@@ -96,6 +96,7 @@ extern int handle_response(DataNodeHandle * conn, RemoteQueryState *combiner);
extern bool FetchTuple(RemoteQueryState *combiner, TupleTableSlot *slot);
extern void ExecRemoteQueryReScan(RemoteQueryState *node, ExprContext *exprCtxt);
+extern void DataNodeConsumeMessages(void);
extern int primary_data_node;
#endif