]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
if a public address has already been taken over by a node, then let that
authorRonnie Sahlberg <sahlberg@ronnie>
Mon, 20 Aug 2007 04:16:58 +0000 (14:16 +1000)
committerRonnie Sahlberg <sahlberg@ronnie>
Mon, 20 Aug 2007 04:16:58 +0000 (14:16 +1000)
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)

ctdb/server/ctdb_takeover.c

index 4392a596ff796053e26480ce9f10ac648e69f552..aa83000131a8c1005c278665f1bfa4c2f6d62438 100644 (file)
@@ -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);