]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
when a remote node has sent us a message to update the flags for a node,
authorRonnie Sahlberg <sahlberg@ronnie>
Mon, 9 Jul 2007 03:21:17 +0000 (13:21 +1000)
committerRonnie Sahlberg <sahlberg@ronnie>
Mon, 9 Jul 2007 03:21:17 +0000 (13:21 +1000)
dont let those messages modify the DISCONNECTED flag.

the DISCONNECTED flag must be managed locally since it describes whether
the local node can communicate with the remote node or not

(This used to be ctdb commit 5650673205d335a32d4f27f66847ea66752a00f0)

ctdb/server/ctdb_recoverd.c

index bba963b9d1d6367e6727ab3b2e35d348ef86d865..0a07244fe3030e4f7a78acf492290d57a2266f40 100644 (file)
@@ -1068,11 +1068,20 @@ static void monitor_handler(struct ctdb_context *ctdb, uint64_t srvid,
                return;
        }
 
-       if (nodemap->nodes[i].flags != c->flags) {
+       /* Dont let messages from remote nodes change the DISCONNECTED flag. 
+          This flag is handled locally based on whether the local node
+          can communicate with the node or not.
+       */
+       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) {
                DEBUG(0,("Node %u has changed flags - now 0x%x\n", c->vnn, c->flags));
        }
 
-       nodemap->nodes[i].flags = 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);
 
        ret = ctdb_ctrl_getrecmaster(ctdb, CONTROL_TIMEOUT(), 
                                     CTDB_CURRENT_NODE, &ctdb->recovery_master);