[SCM] CTDB repository - branch master updated - ctdb-1.0.114-114-g41dbdd4

Ronnie Sahlberg sahlberg at samba.org
Tue Jun 1 17:52:58 MDT 2010


The branch, master has been updated
       via  41dbdd4fc0ab560420fb0e24a3179ff7c94c5bb7 (commit)
       via  ac3292c12832484a22715f1d46aa23f3b7c8a6f6 (commit)
       via  d643240783d4847591c5f72ee4d65e5daf1dbcf7 (commit)
      from  c0f38e0936c487b63964fd9cef7a9370f227275f (commit)

http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 41dbdd4fc0ab560420fb0e24a3179ff7c94c5bb7
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Jun 2 09:51:47 2010 +1000

    rename ctdb_set_message_handler to ctdb_client_set_message_handler
    to avoid a colission with the function of the same name in libctdb

commit ac3292c12832484a22715f1d46aa23f3b7c8a6f6
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Jun 2 09:45:21 2010 +1000

    rename ctdb_send_message to ctdb_client_send_message to resolve colission with the function of the same name in libctdb

commit d643240783d4847591c5f72ee4d65e5daf1dbcf7
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Jun 2 09:43:16 2010 +1000

    Dont link with libctdb
    
    This makes it easier to ensure we catch all places
    when we rename old api functions due to colissions with
    functions in libctdb

-----------------------------------------------------------------------

Summary of changes:
 Makefile.in            |    2 +-
 client/ctdb_client.c   |    6 +++---
 common/ctdb_logging.c  |    2 +-
 include/ctdb_client.h  |    4 ++--
 server/ctdb_recoverd.c |   28 ++++++++++++++--------------
 server/ctdb_vacuum.c   |    2 +-
 tests/src/ctdb_bench.c |    6 +++---
 tests/src/ctdb_fetch.c |    6 +++---
 tools/ctdb.c           |   18 +++++++++---------
 tools/ctdb_vacuum.c    |    2 +-
 10 files changed, 38 insertions(+), 38 deletions(-)


Changeset truncated at 500 lines:

diff --git a/Makefile.in b/Makefile.in
index 30cbf2e..b72e90e 100755
--- a/Makefile.in
+++ b/Makefile.in
@@ -44,7 +44,7 @@ UTIL_OBJ = lib/util/idtree.o lib/util/db_wrap.o lib/util/strlist.o lib/util/util
 CTDB_COMMON_OBJ =  common/ctdb_io.o common/ctdb_util.o \
 	common/ctdb_ltdb.o common/ctdb_message.o common/cmdline.o  \
 	lib/util/debug.o common/rb_tree.o @CTDB_SYSTEM_OBJ@ common/system_common.o \
-	common/ctdb_logging.c libctdb/libctdb.a
+	common/ctdb_logging.c
 
 CTDB_LIB_OBJ = libctdb/ctdb.o libctdb/io_elem.o libctdb/local_tdb.o \
 	libctdb/messages.o libctdb/sync.o libctdb/control.o
diff --git a/client/ctdb_client.c b/client/ctdb_client.c
index 946335c..9ce5c02 100644
--- a/client/ctdb_client.c
+++ b/client/ctdb_client.c
@@ -474,7 +474,7 @@ int ctdb_call(struct ctdb_db_context *ctdb_db, struct ctdb_call *call)
   tell the daemon what messaging srvid we will use, and register the message
   handler function in the client
 */
-int ctdb_set_message_handler(struct ctdb_context *ctdb, uint64_t srvid, 
+int ctdb_client_set_message_handler(struct ctdb_context *ctdb, uint64_t srvid, 
 			     ctdb_message_fn_t handler,
 			     void *private_data)
 				    
@@ -517,7 +517,7 @@ int ctdb_remove_message_handler(struct ctdb_context *ctdb, uint64_t srvid, void
 /*
   send a message - from client context
  */
-int ctdb_send_message(struct ctdb_context *ctdb, uint32_t pnn,
+int ctdb_client_send_message(struct ctdb_context *ctdb, uint32_t pnn,
 		      uint64_t srvid, TDB_DATA data)
 {
 	struct ctdb_req_message *r;
@@ -1849,7 +1849,7 @@ int ctdb_traverse(struct ctdb_db_context *ctdb_db, ctdb_traverse_func fn, void *
 	state.private_data = private_data;
 	state.fn = fn;
 
-	ret = ctdb_set_message_handler(ctdb_db->ctdb, srvid, traverse_handler, &state);
+	ret = ctdb_client_set_message_handler(ctdb_db->ctdb, srvid, traverse_handler, &state);
 	if (ret != 0) {
 		DEBUG(DEBUG_ERR,("Failed to setup traverse handler\n"));
 		return -1;
diff --git a/common/ctdb_logging.c b/common/ctdb_logging.c
index 6acc060..18aafa2 100644
--- a/common/ctdb_logging.c
+++ b/common/ctdb_logging.c
@@ -144,7 +144,7 @@ static void ctdb_collect_log(struct ctdb_context *ctdb, struct ctdb_get_log_addr
 	DEBUG(DEBUG_ERR,("Marshalling log entries into a blob of %d bytes\n", (int)data.dsize));
 
 	DEBUG(DEBUG_ERR,("Send log to %d:%d\n", (int)log_addr->pnn, (int)log_addr->srvid));
-	ctdb_send_message(ctdb, log_addr->pnn, log_addr->srvid, data);
+	ctdb_client_send_message(ctdb, log_addr->pnn, log_addr->srvid, data);
 
 	talloc_free(data.dptr);
 }
diff --git a/include/ctdb_client.h b/include/ctdb_client.h
index 394b89e..6777b49 100644
--- a/include/ctdb_client.h
+++ b/include/ctdb_client.h
@@ -154,7 +154,7 @@ uint32_t ctdb_get_num_nodes(struct ctdb_context *ctdb);
 /* setup a handler for ctdb messages */
 typedef void (*ctdb_message_fn_t)(struct ctdb_context *, uint64_t srvid,
 				  TDB_DATA data, void *);
-int ctdb_set_message_handler(struct ctdb_context *ctdb, uint64_t srvid,
+int ctdb_client_set_message_handler(struct ctdb_context *ctdb, uint64_t srvid,
 			     ctdb_message_fn_t handler,
 			     void *private_data);
 
@@ -164,7 +164,7 @@ struct ctdb_client_call_state *ctdb_call_send(struct ctdb_db_context *ctdb_db, s
 int ctdb_call_recv(struct ctdb_client_call_state *state, struct ctdb_call *call);
 
 /* send a ctdb message */
-int ctdb_send_message(struct ctdb_context *ctdb, uint32_t pnn,
+int ctdb_client_send_message(struct ctdb_context *ctdb, uint32_t pnn,
 		      uint64_t srvid, TDB_DATA data);
 
 
diff --git a/server/ctdb_recoverd.c b/server/ctdb_recoverd.c
index ae4242f..3a2242e 100644
--- a/server/ctdb_recoverd.c
+++ b/server/ctdb_recoverd.c
@@ -1641,7 +1641,7 @@ static int do_recovery(struct ctdb_recoverd *rec,
 
 	/* send a message to all clients telling them that the cluster 
 	   has been reconfigured */
-	ctdb_send_message(ctdb, CTDB_BROADCAST_CONNECTED, CTDB_SRVID_RECONFIGURE, tdb_null);
+	ctdb_client_send_message(ctdb, CTDB_BROADCAST_CONNECTED, CTDB_SRVID_RECONFIGURE, tdb_null);
 
 	DEBUG(DEBUG_NOTICE, (__location__ " Recovery complete\n"));
 
@@ -1802,7 +1802,7 @@ static int send_election_request(struct ctdb_recoverd *rec, uint32_t pnn, bool u
 
 	/* send an election message to all active nodes */
 	DEBUG(DEBUG_INFO,(__location__ " Send election request to all active nodes\n"));
-	ctdb_send_message(ctdb, CTDB_BROADCAST_ALL, srvid, election_data);
+	ctdb_client_send_message(ctdb, CTDB_BROADCAST_ALL, srvid, election_data);
 
 
 	/* A new node that is already frozen has entered the cluster.
@@ -1900,7 +1900,7 @@ static void mem_dump_handler(struct ctdb_context *ctdb, uint64_t srvid,
 
 DEBUG(DEBUG_ERR, ("recovery master memory dump\n"));		
 
-	ret = ctdb_send_message(ctdb, rd->pnn, rd->srvid, *dump);
+	ret = ctdb_client_send_message(ctdb, rd->pnn, rd->srvid, *dump);
 	if (ret != 0) {
 		DEBUG(DEBUG_ERR,("Failed to send rd memdump reply message\n"));
 		talloc_free(tmp_ctx);
@@ -2059,7 +2059,7 @@ static void process_ipreallocate_requests(struct ctdb_context *ctdb, struct ctdb
 		DEBUG(DEBUG_INFO,("Sending ip reallocate reply message to "
 				  "%u:%llu\n", (unsigned)callers->rd->pnn,
 				  (unsigned long long)callers->rd->srvid));
-		ret = ctdb_send_message(ctdb, callers->rd->pnn, callers->rd->srvid, result);
+		ret = ctdb_client_send_message(ctdb, callers->rd->pnn, callers->rd->srvid, result);
 		if (ret != 0) {
 			DEBUG(DEBUG_ERR,("Failed to send ip reallocate reply "
 					 "message to %u:%llu\n",
@@ -2607,7 +2607,7 @@ static int verify_local_ip_allocation(struct ctdb_context *ctdb, struct ctdb_rec
 		data.dptr = (uint8_t *)&rd;
 		data.dsize = sizeof(rd);
 
-		ret = ctdb_send_message(ctdb, rec->recmaster, CTDB_SRVID_TAKEOVER_RUN, data);
+		ret = ctdb_client_send_message(ctdb, rec->recmaster, CTDB_SRVID_TAKEOVER_RUN, data);
 		if (ret != 0) {
 			DEBUG(DEBUG_ERR,(__location__ " Failed to send ipreallocate to recmaster :%d\n", (int)rec->recmaster));
 		}
@@ -2904,31 +2904,31 @@ static void monitor_cluster(struct ctdb_context *ctdb)
 	rec->priority_time = timeval_current();
 
 	/* register a message port for sending memory dumps */
-	ctdb_set_message_handler(ctdb, CTDB_SRVID_MEM_DUMP, mem_dump_handler, rec);
+	ctdb_client_set_message_handler(ctdb, CTDB_SRVID_MEM_DUMP, mem_dump_handler, rec);
 
 	/* register a message port for recovery elections */
-	ctdb_set_message_handler(ctdb, CTDB_SRVID_RECOVERY, election_handler, rec);
+	ctdb_client_set_message_handler(ctdb, CTDB_SRVID_RECOVERY, election_handler, rec);
 
 	/* when nodes are disabled/enabled */
-	ctdb_set_message_handler(ctdb, CTDB_SRVID_SET_NODE_FLAGS, monitor_handler, rec);
+	ctdb_client_set_message_handler(ctdb, CTDB_SRVID_SET_NODE_FLAGS, monitor_handler, rec);
 
 	/* when we are asked to puch out a flag change */
-	ctdb_set_message_handler(ctdb, CTDB_SRVID_PUSH_NODE_FLAGS, push_flags_handler, rec);
+	ctdb_client_set_message_handler(ctdb, CTDB_SRVID_PUSH_NODE_FLAGS, push_flags_handler, rec);
 
 	/* register a message port for vacuum fetch */
-	ctdb_set_message_handler(ctdb, CTDB_SRVID_VACUUM_FETCH, vacuum_fetch_handler, rec);
+	ctdb_client_set_message_handler(ctdb, CTDB_SRVID_VACUUM_FETCH, vacuum_fetch_handler, rec);
 
 	/* register a message port for reloadnodes  */
-	ctdb_set_message_handler(ctdb, CTDB_SRVID_RELOAD_NODES, reload_nodes_handler, rec);
+	ctdb_client_set_message_handler(ctdb, CTDB_SRVID_RELOAD_NODES, reload_nodes_handler, rec);
 
 	/* register a message port for performing a takeover run */
-	ctdb_set_message_handler(ctdb, CTDB_SRVID_TAKEOVER_RUN, ip_reallocate_handler, rec);
+	ctdb_client_set_message_handler(ctdb, CTDB_SRVID_TAKEOVER_RUN, ip_reallocate_handler, rec);
 
 	/* register a message port for disabling the ip check for a short while */
-	ctdb_set_message_handler(ctdb, CTDB_SRVID_DISABLE_IP_CHECK, disable_ip_check_handler, rec);
+	ctdb_client_set_message_handler(ctdb, CTDB_SRVID_DISABLE_IP_CHECK, disable_ip_check_handler, rec);
 
 	/* register a message port for updating the recovery daemons node assignment for an ip */
-	ctdb_set_message_handler(ctdb, CTDB_SRVID_RECD_UPDATE_IP, recd_update_ip_handler, rec);
+	ctdb_client_set_message_handler(ctdb, CTDB_SRVID_RECD_UPDATE_IP, recd_update_ip_handler, rec);
 
 again:
 	if (mem_ctx) {
diff --git a/server/ctdb_vacuum.c b/server/ctdb_vacuum.c
index 580686e..f1e61db 100644
--- a/server/ctdb_vacuum.c
+++ b/server/ctdb_vacuum.c
@@ -272,7 +272,7 @@ static int ctdb_vacuum_db(struct ctdb_db_context *ctdb_db, struct vacuum_data *v
 
 			data.dsize = talloc_get_size(vdata->list[i]);
 			data.dptr  = (void *)vdata->list[i];
-			if (ctdb_send_message(ctdb, ctdb->vnn_map->map[i], CTDB_SRVID_VACUUM_FETCH, data) != 0) {
+			if (ctdb_client_send_message(ctdb, ctdb->vnn_map->map[i], CTDB_SRVID_VACUUM_FETCH, data) != 0) {
 				DEBUG(DEBUG_ERR,(__location__ " Failed to send vacuum fetch message to %u\n",
 					 ctdb->vnn_map->map[i]));
 				return -1;		
diff --git a/tests/src/ctdb_bench.c b/tests/src/ctdb_bench.c
index 2c5a654..17153f5 100644
--- a/tests/src/ctdb_bench.c
+++ b/tests/src/ctdb_bench.c
@@ -94,7 +94,7 @@ static void ring_message_handler(struct ctdb_context *ctdb, uint64_t srvid,
 
 	(*count)++;
 	dest = (ctdb_get_pnn(ctdb) + num_nodes + incr) % num_nodes;
-	ctdb_send_message(ctdb, dest, srvid, data);
+	ctdb_client_send_message(ctdb, dest, srvid, data);
 	if (incr == 1) {
 		msg_plus++;
 	} else {
@@ -114,7 +114,7 @@ static void send_start_messages(struct ctdb_context *ctdb, int incr)
 	data.dsize = sizeof(incr);
 
 	dest = (ctdb_get_pnn(ctdb) + num_nodes + incr) % num_nodes;
-	ctdb_send_message(ctdb, dest, 0, data);
+	ctdb_client_send_message(ctdb, dest, 0, data);
 }
 
 static void each_second(struct event_context *ev, struct timed_event *te, 
@@ -235,7 +235,7 @@ int main(int argc, const char *argv[])
 	ret = ctdb_set_call(ctdb_db, incr_func,  FUNC_INCR);
 	ret = ctdb_set_call(ctdb_db, fetch_func, FUNC_FETCH);
 
-	if (ctdb_set_message_handler(ctdb, 0, ring_message_handler,&msg_count))
+	if (ctdb_client_set_message_handler(ctdb, 0, ring_message_handler,&msg_count))
 		goto error;
 
 	printf("Waiting for cluster\n");
diff --git a/tests/src/ctdb_fetch.c b/tests/src/ctdb_fetch.c
index ec53ac9..0ab45aa 100644
--- a/tests/src/ctdb_fetch.c
+++ b/tests/src/ctdb_fetch.c
@@ -99,7 +99,7 @@ static void bench_fetch_1node(struct ctdb_context *ctdb)
 	nulldata.dsize = 0;
 
 	dest = (ctdb_get_pnn(ctdb) + 1) % num_nodes;
-	ctdb_send_message(ctdb, dest, 0, nulldata);
+	ctdb_client_send_message(ctdb, dest, 0, nulldata);
 }
 
 /*
@@ -209,7 +209,7 @@ int main(int argc, const char *argv[])
 
 	ctdb = ctdb_cmdline_client(ev);
 
-	ctdb_set_message_handler(ctdb, CTDB_SRVID_RECONFIGURE, reconfigure_handler, 
+	ctdb_client_set_message_handler(ctdb, CTDB_SRVID_RECONFIGURE, reconfigure_handler, 
 				 &cluster_ready);
 
 	/* attach to a specific database */
@@ -219,7 +219,7 @@ int main(int argc, const char *argv[])
 		exit(1);
 	}
 
-	ctdb_set_message_handler(ctdb, 0, message_handler, &msg_count);
+	ctdb_client_set_message_handler(ctdb, 0, message_handler, &msg_count);
 
 	printf("Waiting for cluster\n");
 	while (1) {
diff --git a/tools/ctdb.c b/tools/ctdb.c
index f13ce79..3fad1e1 100644
--- a/tools/ctdb.c
+++ b/tools/ctdb.c
@@ -1012,7 +1012,7 @@ static int move_ip(struct ctdb_context *ctdb, ctdb_sock_addr *addr, uint32_t pnn
 	disable_time = 30;
 	data.dptr  = (uint8_t*)&disable_time;
 	data.dsize = sizeof(disable_time);
-	ret = ctdb_send_message(ctdb, CTDB_BROADCAST_CONNECTED, CTDB_SRVID_DISABLE_IP_CHECK, data);
+	ret = ctdb_client_send_message(ctdb, CTDB_BROADCAST_CONNECTED, CTDB_SRVID_DISABLE_IP_CHECK, data);
 	if (ret != 0) {
 		DEBUG(DEBUG_ERR,("Failed to send message to disable ipcheck\n"));
 		return -1;
@@ -1076,7 +1076,7 @@ static int move_ip(struct ctdb_context *ctdb, ctdb_sock_addr *addr, uint32_t pnn
 	/* update the recovery daemon so it now knows to expect the new
 	   node assignment for this ip.
 	*/
-	ret = ctdb_send_message(ctdb, CTDB_BROADCAST_CONNECTED, CTDB_SRVID_RECD_UPDATE_IP, data);
+	ret = ctdb_client_send_message(ctdb, CTDB_BROADCAST_CONNECTED, CTDB_SRVID_RECD_UPDATE_IP, data);
 	if (ret != 0) {
 		DEBUG(DEBUG_ERR,("Failed to send message to update the ip on the recovery master.\n"));
 		return -1;
@@ -2001,7 +2001,7 @@ static int control_ipreallocate(struct ctdb_context *ctdb, int argc, const char
 	/* register a message port for receiveing the reply so that we
 	   can receive the reply
 	*/
-	ctdb_set_message_handler(ctdb, rd.srvid, ip_reallocate_handler, NULL);
+	ctdb_client_set_message_handler(ctdb, rd.srvid, ip_reallocate_handler, NULL);
 
 	data.dptr = (uint8_t *)&rd;
 	data.dsize = sizeof(rd);
@@ -2066,7 +2066,7 @@ again:
 	} 
 
 	ipreallocate_finished = 0;
-	ret = ctdb_send_message(ctdb, recmaster, CTDB_SRVID_TAKEOVER_RUN, data);
+	ret = ctdb_client_send_message(ctdb, recmaster, CTDB_SRVID_TAKEOVER_RUN, data);
 	if (ret != 0) {
 		DEBUG(DEBUG_ERR,("Failed to send ip takeover run request message to %u\n", options.pnn));
 		return -1;
@@ -2773,7 +2773,7 @@ static int control_getlog(struct ctdb_context *ctdb, int argc, const char **argv
 
 	DEBUG(DEBUG_ERR, ("Pulling logs from node %u\n", options.pnn));
 
-	ctdb_set_message_handler(ctdb, log_addr.srvid, log_handler, NULL);
+	ctdb_client_set_message_handler(ctdb, log_addr.srvid, log_handler, NULL);
 	sleep(1);
 
 	DEBUG(DEBUG_ERR,("Listen for response on %d\n", (int)log_addr.srvid));
@@ -4139,13 +4139,13 @@ static int control_rddumpmemory(struct ctdb_context *ctdb, int argc, const char
 	/* register a message port for receiveing the reply so that we
 	   can receive the reply
 	*/
-	ctdb_set_message_handler(ctdb, rd.srvid, mem_dump_handler, NULL);
+	ctdb_client_set_message_handler(ctdb, rd.srvid, mem_dump_handler, NULL);
 
 
 	data.dptr = (uint8_t *)&rd;
 	data.dsize = sizeof(rd);
 
-	ret = ctdb_send_message(ctdb, options.pnn, CTDB_SRVID_MEM_DUMP, data);
+	ret = ctdb_client_send_message(ctdb, options.pnn, CTDB_SRVID_MEM_DUMP, data);
 	if (ret != 0) {
 		DEBUG(DEBUG_ERR,("Failed to send memdump request message to %u\n", options.pnn));
 		return -1;
@@ -4177,7 +4177,7 @@ static int control_msgsend(struct ctdb_context *ctdb, int argc, const char **arg
 	data.dptr = (uint8_t *)discard_const(argv[1]);
 	data.dsize= strlen(argv[1]);
 
-	ret = ctdb_send_message(ctdb, CTDB_BROADCAST_CONNECTED, srvid, data);
+	ret = ctdb_client_send_message(ctdb, CTDB_BROADCAST_CONNECTED, srvid, data);
 	if (ret != 0) {
 		DEBUG(DEBUG_ERR,("Failed to send memdump request message to %u\n", options.pnn));
 		return -1;
@@ -4212,7 +4212,7 @@ static int control_msglisten(struct ctdb_context *ctdb, int argc, const char **a
 
 	/* register a message port and listen for messages
 	*/
-	ctdb_set_message_handler(ctdb, srvid, msglisten_handler, NULL);
+	ctdb_client_set_message_handler(ctdb, srvid, msglisten_handler, NULL);
 	printf("Listening for messages on srvid:%d\n", (int)srvid);
 
 	while (1) {	
diff --git a/tools/ctdb_vacuum.c b/tools/ctdb_vacuum.c
index 315912c..c761583 100644
--- a/tools/ctdb_vacuum.c
+++ b/tools/ctdb_vacuum.c
@@ -308,7 +308,7 @@ static int ctdb_vacuum_db(struct ctdb_context *ctdb, uint32_t db_id, struct ctdb
 
 			data.dsize = talloc_get_size(vdata->list[i]);
 			data.dptr  = (void *)vdata->list[i];
-			if (ctdb_send_message(ctdb, ctdb->vnn_map->map[i], CTDB_SRVID_VACUUM_FETCH, data) != 0) {
+			if (ctdb_client_send_message(ctdb, ctdb->vnn_map->map[i], CTDB_SRVID_VACUUM_FETCH, data) != 0) {
 				DEBUG(DEBUG_ERR,(__location__ " Failed to send vacuum fetch message to %u\n",
 					 ctdb->vnn_map->map[i]));
 				talloc_free(vdata);


-- 
CTDB repository


More information about the samba-cvs mailing list