]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
nicer handling of DISCONNECTED flag when we update the node flags from
authorRonnie Sahlberg <sahlberg@ronnie>
Mon, 9 Jul 2007 07:40:15 +0000 (17:40 +1000)
committerRonnie Sahlberg <sahlberg@ronnie>
Mon, 9 Jul 2007 07:40:15 +0000 (17:40 +1000)
a remote message

(This used to be ctdb commit 9a50ad22be61a09761ffda89de91ef3221917c84)

ctdb/server/ctdb_recoverd.c

index 0a07244fe3030e4f7a78acf492290d57a2266f40..148082687827e9cf833c6444b2c61e731bc79adb 100644 (file)
@@ -1073,15 +1073,15 @@ static void monitor_handler(struct ctdb_context *ctdb, uint64_t srvid,
           can communicate with the node or not.
        */
        c->flags &= ~NODE_FLAGS_DISCONNECTED;
+       if (nodemap->nodes[i].flags&NODE_FLAGS_DISCONNECTED) {
+               c->flags |= NODE_FLAGS_DISCONNECTED;
+       }
 
-       /* check whether the flags (except for the DISCONNECTED flag have changed */
-       if ((nodemap->nodes[i].flags&(~NODE_FLAGS_DISCONNECTED)) != c->flags) {
+       if (nodemap->nodes[i].flags != c->flags) {
                DEBUG(0,("Node %u has changed flags - now 0x%x\n", c->vnn, c->flags));
        }
 
-       /* Update the flags but leave the DISCONNECTED flag as is */
-       nodemap->nodes[i].flags = c->flags 
-         | (nodemap->nodes[i].flags&NODE_FLAGS_DISCONNECTED);
+       nodemap->nodes[i].flags = c->flags;
 
        ret = ctdb_ctrl_getrecmaster(ctdb, CONTROL_TIMEOUT(), 
                                     CTDB_CURRENT_NODE, &ctdb->recovery_master);