------------------------------------------------------------
revno: 400
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Wed 2007-05-30 14:35:22 +1000
message:
  - 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
modified:
  common/ctdb.c                  ctdb.c-20061127094323-t50f58d65iaao5of-2
  common/ctdb_daemon.c           ctdb_daemon.c-20070409200331-3el1kqgdb9m4ib0g-1
  common/ctdb_ltdb.c             ctdb_ltdb.c-20061128065342-to93h6eejj5kon81-2
=== modified file 'common/ctdb.c'
--- a/common/ctdb.c     2007-05-29 06:23:47 +0000
+++ b/common/ctdb.c     2007-05-30 04:35:22 +0000
@@ -371,6 +371,12 @@
 */
 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_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;

=== modified file 'common/ctdb_daemon.c'
--- a/common/ctdb_daemon.c      2007-05-30 03:26:50 +0000
+++ b/common/ctdb_daemon.c      2007-05-30 04:35:22 +0000
@@ -50,6 +50,9 @@
                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 @@
 
        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"));

=== modified file 'common/ctdb_ltdb.c'
--- a/common/ctdb_ltdb.c        2007-05-29 03:48:30 +0000
+++ b/common/ctdb_ltdb.c        2007-05-30 04:35:22 +0000
@@ -425,7 +425,7 @@
        }
        
        /* 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);
 

Reply via email to