From: Andrew Tridgell Date: Wed, 30 May 2007 04:35:22 +0000 (+1000) Subject: - use a CTDB_BROADCAST_ALL for the attach message so it goes to currently disconnecte... X-Git-Tag: tevent-0.9.20~348^2~2631 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3c062bb5aee3b66c2669c88e0a4536c6b9697837;p=thirdparty%2Fsamba.git - use a CTDB_BROADCAST_ALL for the attach message so it goes to currently disconnected nodes - start node monitoring only after transport starts - check if a node is already disconnected in the node dead function (This used to be ctdb commit b81ab6d507797282237768380c6f0e5a4c6519a5) --- diff --git a/ctdb/common/ctdb.c b/ctdb/common/ctdb.c index b7949f75e52..3ceeaeb2a93 100644 --- a/ctdb/common/ctdb.c +++ b/ctdb/common/ctdb.c @@ -371,6 +371,12 @@ static void ctdb_recv_pkt(struct ctdb_context *ctdb, uint8_t *data, uint32_t len */ void ctdb_node_dead(struct ctdb_node *node) { + if (!(node->flags & NODE_FLAGS_CONNECTED)) { + DEBUG(1,("%s: node %s is already marked disconnected: %u connected\n", + node->ctdb->name, node->name, + node->ctdb->num_connected)); + return; + } node->ctdb->num_connected--; node->flags &= ~NODE_FLAGS_CONNECTED; node->rx_cnt = 0; @@ -385,6 +391,12 @@ void ctdb_node_dead(struct ctdb_node *node) */ void ctdb_node_connected(struct ctdb_node *node) { + if (node->flags & NODE_FLAGS_CONNECTED) { + DEBUG(1,("%s: node %s is already marked connected: %u connected\n", + node->ctdb->name, node->name, + node->ctdb->num_connected)); + return; + } node->ctdb->num_connected++; node->dead_count = 0; node->flags |= NODE_FLAGS_CONNECTED; diff --git a/ctdb/common/ctdb_daemon.c b/ctdb/common/ctdb_daemon.c index 1ffd70f61fe..a8339bb7fec 100644 --- a/ctdb/common/ctdb_daemon.c +++ b/ctdb/common/ctdb_daemon.c @@ -50,6 +50,9 @@ static void ctdb_start_transport(struct ctdb_context *ctdb, int status) DEBUG(0,("Failed to start recovery daemon\n")); exit(11); } + + /* start monitoring for dead nodes */ + ctdb_start_monitoring(ctdb); } /* go into main ctdb loop */ @@ -772,9 +775,6 @@ int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork) ctdb->ev = event_context_init(NULL); - /* start monitoring for dead nodes */ - ctdb_start_monitoring(ctdb); - /* start frozen, then let the first election sort things out */ if (!ctdb_blocking_freeze(ctdb)) { DEBUG(0,("Failed to get initial freeze\n")); diff --git a/ctdb/common/ctdb_ltdb.c b/ctdb/common/ctdb_ltdb.c index 0347c46ae62..8d87bd24f0a 100644 --- a/ctdb/common/ctdb_ltdb.c +++ b/ctdb/common/ctdb_ltdb.c @@ -425,7 +425,7 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata, } /* tell all the other nodes about this database */ - ctdb_daemon_send_control(ctdb, CTDB_BROADCAST_VNNMAP, 0, + ctdb_daemon_send_control(ctdb, CTDB_BROADCAST_ALL, 0, CTDB_CONTROL_DB_ATTACH, 0, CTDB_CTRL_FLAG_NOREPLY, indata, NULL, NULL);