From: Ronnie Sahlberg Date: Mon, 20 Aug 2007 04:16:58 +0000 (+1000) Subject: if a public address has already been taken over by a node, then let that X-Git-Tag: tevent-0.9.20~348^2~2437^2~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7e1f840c8d50ded286b3e300d7660f3cb96124cb;p=thirdparty%2Fsamba.git if a public address has already been taken over by a node, then let that public address remain at that node until either the node becomes unhealthy or the original/primary node for that address becomes healthy again. Othervise what will happen is 1, if we ban a node, the banning code immediately does a takeover_run() and reassigns the public address to a different node in the cluster. 2, a few seconds later (at most) the recovery daemon will detect that the number of nodes has shrunk and will initiate a recovery. During the recovery the public address would again be assigned to a node, this time a different node. (This used to be ctdb commit 30a6b7a648e22873d8ce6289a3d6dc42c4b9e3b3) --- diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c index 4392a596ff7..aa83000131a 100644 --- a/ctdb/server/ctdb_takeover.c +++ b/ctdb/server/ctdb_takeover.c @@ -524,6 +524,19 @@ int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap) if (!(nodemap->nodes[i].flags & (NODE_FLAGS_INACTIVE|NODE_FLAGS_DISABLED))) { ctdb->nodes[i]->takeover_vnn = nodemap->nodes[i].vnn; } else { + uint32_t takeover_vnn; + + /* If this public address has already been taken over + by a node and that node is still healthy, then + leave the public address at that node. + */ + takeover_vnn = ctdb->nodes[i]->takeover_vnn; + if ( ctdb_validate_vnn(ctdb, takeover_vnn) + && (!(nodemap->nodes[takeover_vnn].flags & (NODE_FLAGS_INACTIVE|NODE_FLAGS_DISABLED))) ) { + continue; + } + + ctdb->nodes[i]->takeover_vnn = (uint32_t)-1; ctdb_takeover_find_node(ctdb, nodemap, i, NODE_FLAGS_INACTIVE|NODE_FLAGS_DISABLED);