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