static bool ctdb_vnn_available(struct ctdb_context *ctdb,
struct ctdb_vnn *vnn)
{
+ uint32_t flags;
struct vnn_interface *i;
/* Nodes that are not RUNNING can not host IPs */
return false;
}
+ flags = ctdb->nodes[ctdb->pnn]->flags;
+ if ((flags & (NODE_FLAGS_INACTIVE|NODE_FLAGS_DISABLED)) != 0) {
+ return false;
+ }
+
if (vnn->delete_pending) {
return false;
}
uint32_t noiptakeover;
ctdb_sock_addr sa_zero = { .ip = { 0 } };
enum ipalloc_algorithm algorithm;
+ uint32_t n;
/* Avoid that const */
ns = talloc_strdup(mem_ctx, nodestates);
nodemap->num = 0;
tok = strtok(ns, ",");
while (tok != NULL) {
- uint32_t n = nodemap->num;
+ n = nodemap->num;
nodemap->node = talloc_realloc(nodemap, nodemap->node,
struct ctdb_node_and_flags, n+1);
nodemap->node[n].pnn = n;
read_ips_for_multiple_nodes,
&known, &avail);
+ /* Drop available IPs for INACTIVE/DISABLED nodes */
+ for (n = 0; n < nodemap->num; n++) {
+ uint32_t flags = nodemap->node[n].flags;
+ if ((flags & (NODE_FLAGS_INACTIVE|NODE_FLAGS_DISABLED)) != 0) {
+ avail[n].num = 0;
+ }
+ }
+
ipalloc_set_public_ips(*ipalloc_state, known, avail);
ipalloc_set_node_flags(*ipalloc_state, nodemap);
* no available IPs. Don't worry about interface
* states here - we're not faking down to that level.
*/
- if (ctdb->runstate != CTDB_RUNSTATE_RUNNING) {
+ uint32_t flags = ctdb->node_map->node[header->destnode].flags;
+ if (ctdb->runstate != CTDB_RUNSTATE_RUNNING ||
+ ((flags & (NODE_FLAGS_INACTIVE|NODE_FLAGS_DISABLED)) != 0)) {
/* No available IPs: return dummy empty struct */
ips = talloc_zero(mem_ctx, struct ctdb_public_ip_list);;
if (ips == NULL) {