summaryrefslogtreecommitdiffstats
path: root/ctdb/include
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-05-18 22:11:58 +1000
committerAndrew Tridgell <tridge@samba.org>2007-05-18 22:11:58 +1000
commit9ea6e3ca8b05a2e291654d9fe01c3fa4dbec5c30 (patch)
tree042c32b6ef454fbe5ad3b5836b5eeefe1bb2cf0b /ctdb/include
parent2d9f0ee60656e60b87b7aa16a789b11e8abeae75 (diff)
parent334a294481f2a074bc7f975c7a0ec42901af9934 (diff)
merge keepalive code from ronnie
(This used to be ctdb commit 0218a8eafe3889e0996a375bf54fa5306e719392)
Diffstat (limited to 'ctdb/include')
-rw-r--r--ctdb/include/ctdb_private.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h
index 3188c51a60..47d0fbb991 100644
--- a/ctdb/include/ctdb_private.h
+++ b/ctdb/include/ctdb_private.h
@@ -89,6 +89,10 @@ struct ctdb_node {
uint32_t vnn;
#define NODE_FLAGS_CONNECTED 0x00000001
uint32_t flags;
+
+ /* used by the dead node monitoring */
+ uint32_t dead_count;
+ uint32_t rx_cnt;
};
/*
@@ -143,6 +147,8 @@ struct ctdb_status {
uint32_t client_packets_recv;
uint32_t node_packets_sent;
uint32_t node_packets_recv;
+ uint32_t keepalive_packets_sent;
+ uint32_t keepalive_packets_recv;
struct {
uint32_t req_call;
uint32_t reply_call;
@@ -302,6 +308,9 @@ struct ctdb_db_context {
the traverse */
#define CTDB_TRAVERSE_TIMEOUT 20
+/* timeout between dead-node monitoring events */
+#define CTDB_MONITORING_TIMEOUT 5
+
/* number of consecutive calls from the same node before we give them
the record */
@@ -410,6 +419,7 @@ enum ctdb_operation {
CTDB_REQ_FINISHED,
CTDB_REQ_CONTROL,
CTDB_REPLY_CONTROL,
+ CTDB_REQ_KEEPALIVE,
/* only used on the domain socket */
CTDB_REQ_CONNECT_WAIT = 1000,
@@ -533,6 +543,9 @@ struct ctdb_reply_control {
uint8_t data[1];
};
+struct ctdb_req_keepalive {
+ struct ctdb_req_header hdr;
+};
/* internal prototypes */
void ctdb_set_error(struct ctdb_context *ctdb, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
@@ -697,6 +710,7 @@ void *_ctdb_reqid_find(struct ctdb_context *ctdb, uint32_t reqid, const char *ty
void ctdb_reqid_remove(struct ctdb_context *ctdb, uint32_t reqid);
void ctdb_request_control(struct ctdb_context *ctdb, struct ctdb_req_header *hdr);
+void ctdb_request_keepalive(struct ctdb_context *ctdb, struct ctdb_req_header *hdr);
void ctdb_reply_control(struct ctdb_context *ctdb, struct ctdb_req_header *hdr);
int ctdb_daemon_send_control(struct ctdb_context *ctdb, uint32_t destnode,
@@ -804,4 +818,7 @@ int ctdb_start_recoverd(struct ctdb_context *ctdb);
uint32_t ctdb_get_num_connected_nodes(struct ctdb_context *ctdb);
+int ctdb_start_monitoring(struct ctdb_context *ctdb);
+void ctdb_send_keepalive(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, uint32_t destnode);
+
#endif