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);