diff options
| author | Ronnie Sahlberg <sahlberg@ronnie> | 2007-04-29 23:49:27 +1000 |
|---|---|---|
| committer | Ronnie Sahlberg <sahlberg@ronnie> | 2007-04-29 23:49:27 +1000 |
| commit | f67a79ad8ef6ce21aaefa75ecf04d447c92d11bc (patch) | |
| tree | ed87d2dc821af1896700dc2d422b62c7d6d2acaf /ctdb/include | |
| parent | 77ce5750b2a18c1b4a82f3bc982fbb3ea465b60c (diff) | |
| parent | 10910f52eb1e62bf5393952f4c3a7380bf2dc548 (diff) | |
| download | samba-f67a79ad8ef6ce21aaefa75ecf04d447c92d11bc.tar.gz samba-f67a79ad8ef6ce21aaefa75ecf04d447c92d11bc.tar.xz samba-f67a79ad8ef6ce21aaefa75ecf04d447c92d11bc.zip | |
merge from tridge
(This used to be ctdb commit a84e9b47a87fc7d4756b4a179aa2ea0bc7c54c78)
Diffstat (limited to 'ctdb/include')
| -rw-r--r-- | ctdb/include/ctdb.h | 8 | ||||
| -rw-r--r-- | ctdb/include/ctdb_private.h | 41 |
2 files changed, 22 insertions, 27 deletions
diff --git a/ctdb/include/ctdb.h b/ctdb/include/ctdb.h index aa2f31fa34..1e382b4b8c 100644 --- a/ctdb/include/ctdb.h +++ b/ctdb/include/ctdb.h @@ -239,7 +239,8 @@ struct ctdb_node_map { uint32_t num; struct ctdb_node_and_flags *nodes; }; -int ctdb_getnodemap(struct ctdb_context *ctdb, uint32_t destnode, struct ctdb_node_map *nodemap); +int ctdb_getnodemap(struct ctdb_context *ctdb, uint32_t destnode, + TALLOC_CTX *mem_ctx, struct ctdb_node_map *nodemap); struct ctdb_key_list { uint32_t num; @@ -288,4 +289,9 @@ int ctdb_getrecmode(struct ctdb_context *ctdb, uint32_t destnode, uint32_t *recm */ int ctdb_setrecmode(struct ctdb_context *ctdb, uint32_t destnode, uint32_t recmode); +uint32_t *ctdb_get_connected_nodes(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, + uint32_t *num_nodes); + +int ctdb_status_reset(struct ctdb_context *ctdb, uint32_t destnode); + #endif diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index 73de824f33..e3b33ff6bf 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -135,7 +135,6 @@ struct ctdb_status { struct { uint32_t req_call; uint32_t reply_call; - uint32_t reply_redirect; uint32_t req_dmaster; uint32_t reply_dmaster; uint32_t reply_error; @@ -157,7 +156,7 @@ struct ctdb_status { uint32_t pending_calls; uint32_t lockwait_calls; uint32_t pending_lockwait_calls; - uint32_t max_redirect_count; + uint32_t __last_counter; /* hack for control_status_all */ double max_call_latency; double max_lockwait_latency; }; @@ -196,6 +195,7 @@ struct ctdb_context { struct ctdb_daemon_data daemon; struct ctdb_status status; struct ctdb_vnn_map *vnn_map; + uint32_t num_clients; }; struct ctdb_db_context { @@ -228,9 +228,6 @@ struct ctdb_db_context { /* arbitrary maximum timeout for ctdb operations */ #define CTDB_REQ_TIMEOUT 0 -/* max number of redirects before we ask the lmaster */ -#define CTDB_MAX_REDIRECT 2 - /* number of consecutive calls from the same node before we give them the record */ #define CTDB_DEFAULT_MAX_LACOUNT 7 @@ -261,7 +258,8 @@ enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS, CTDB_CONTROL_CLEAR_DB, CTDB_CONTROL_PULL_DB, CTDB_CONTROL_GET_RECMODE, - CTDB_CONTROL_SET_RECMODE}; + CTDB_CONTROL_SET_RECMODE, + CTDB_CONTROL_STATUS_RESET}; enum call_state {CTDB_CALL_WAIT, CTDB_CALL_DONE, CTDB_CALL_ERROR}; @@ -273,10 +271,8 @@ struct ctdb_call_state { uint32_t reqid; struct ctdb_req_call *c; struct ctdb_db_context *ctdb_db; - struct ctdb_node *node; const char *errmsg; struct ctdb_call call; - int redirect_count; struct ctdb_ltdb_header header; struct { void (*fn)(struct ctdb_call_state *); @@ -298,21 +294,20 @@ struct ctdb_fetch_handle { */ enum ctdb_operation { CTDB_REQ_CALL = 0, - CTDB_REPLY_CALL = 1, - CTDB_REPLY_REDIRECT = 2, - CTDB_REQ_DMASTER = 3, - CTDB_REPLY_DMASTER = 4, - CTDB_REPLY_ERROR = 5, - CTDB_REQ_MESSAGE = 6, - CTDB_REQ_FINISHED = 7, - CTDB_REQ_CONTROL = 8, - CTDB_REPLY_CONTROL = 9, + CTDB_REPLY_CALL, + CTDB_REQ_DMASTER, + CTDB_REPLY_DMASTER, + CTDB_REPLY_ERROR, + CTDB_REQ_MESSAGE, + CTDB_REQ_FINISHED, + CTDB_REQ_CONTROL, + CTDB_REPLY_CONTROL, /* only used on the domain socket */ CTDB_REQ_REGISTER = 1000, - CTDB_REQ_CONNECT_WAIT = 1001, - CTDB_REPLY_CONNECT_WAIT = 1002, - CTDB_REQ_SHUTDOWN = 1003 + CTDB_REQ_CONNECT_WAIT, + CTDB_REPLY_CONNECT_WAIT, + CTDB_REQ_SHUTDOWN }; #define CTDB_MAGIC 0x43544442 /* CTDB */ @@ -356,11 +351,6 @@ struct ctdb_reply_error { uint8_t msg[1]; }; -struct ctdb_reply_redirect { - struct ctdb_req_header hdr; - uint32_t dmaster; -}; - struct ctdb_req_dmaster { struct ctdb_req_header hdr; uint32_t db_id; @@ -447,7 +437,6 @@ void ctdb_request_message(struct ctdb_context *ctdb, struct ctdb_req_header *hdr void ctdb_reply_dmaster(struct ctdb_context *ctdb, struct ctdb_req_header *hdr); void ctdb_reply_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr); void ctdb_reply_error(struct ctdb_context *ctdb, struct ctdb_req_header *hdr); -void ctdb_reply_redirect(struct ctdb_context *ctdb, struct ctdb_req_header *hdr); uint32_t ctdb_lmaster(struct ctdb_context *ctdb, const TDB_DATA *key); int ctdb_ltdb_fetch(struct ctdb_db_context *ctdb_db, |
