summaryrefslogtreecommitdiff
path: root/ctdb/common/cmdline.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <sahlberg@ronnie>2007-08-24 15:53:41 +1000
committerRonnie Sahlberg <sahlberg@ronnie>2007-08-24 15:53:41 +1000
commit6681da31df926625ce73b3e9047caa7ff4065792 (patch)
treecd2987b434464bab967c47e1965c5f5a56e43192 /ctdb/common/cmdline.c
parentde23937368088327059214f72f083f896f4e1fed (diff)
downloadsamba-6681da31df926625ce73b3e9047caa7ff4065792.tar.gz
add an initial implementation of a service_id structure and three
controls to register/unregister/check a server id. a server id consists of TYPE:VNN:ID where type is specific to the application. VNN is the node where the serverid was registered and ID might be a node unique identifier such as a pid or similar. Clients can register a server id for themself at the local ctdb daemon. When a client dissappears or when the domain socket connection for the client drops then any and all server ids registered across that domain socket will also be automatically removed from the store. clients can register as many server_ids as they want at the same time but each TYPE:VNN:ID must be globally unique. Clients have the option of explicitely unregister a server id by using the UNREGISTER control. Registration and unregistration can only be done by clients to the local daemon. clients can not register their server id to a remote node. clients can check if a server id does exist on any ctdb node in the network by using the check control (This used to be ctdb commit d44798feec26147c5cc05922cb2186f0ef0307be)
Diffstat (limited to 'ctdb/common/cmdline.c')
-rw-r--r--ctdb/common/cmdline.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ctdb/common/cmdline.c b/ctdb/common/cmdline.c
index f72254e2956..fb5c76aeae5 100644
--- a/ctdb/common/cmdline.c
+++ b/ctdb/common/cmdline.c
@@ -23,6 +23,7 @@
#include "popt.h"
#include "../include/ctdb.h"
#include "../include/ctdb_private.h"
+#include "../common/rb_tree.h"
/* Handle common command line options for ctdb test progs
*/
@@ -87,6 +88,9 @@ struct ctdb_context *ctdb_cmdline_init(struct event_context *ev)
exit(1);
}
+ /* set up the tree to store server ids */
+ ctdb->server_ids = trbt_create(ctdb, 0);
+
return ctdb;
}