if (ctdb_same_address(&ctdb->address, &node->address)) {
ctdb->vnn = node->vnn;
+ node->flags |= NODE_FLAGS_CONNECTED;
}
ctdb->num_nodes++;
hdr->generation));
break;
}
+ /* if we are in recovery mode we discard all traffic
+ until the cluster has recovered.
+ */
+ if (ctdb->recovery_mode != CTDB_RECOVERY_NORMAL) {
+ DEBUG(0,(__location__ " ctdb request %d of type"
+ " %d length %d from node %d to %d"
+ " while we are in recovery mode\n",
+ hdr->reqid, hdr->operation, hdr->length,
+ hdr->srcnode, hdr->destnode));
+ break;
+ }
+
ctdb->status.count.req_call++;
ctdb_request_call(ctdb, hdr);
break;
ctdb_reply_error(ctdb, hdr);
break;
- case CTDB_REPLY_REDIRECT:
- ctdb->status.count.reply_redirect++;
- ctdb_reply_redirect(ctdb, hdr);
- break;
-
case CTDB_REQ_DMASTER:
ctdb->status.count.req_dmaster++;
ctdb_request_dmaster(ctdb, hdr);
static void ctdb_node_dead(struct ctdb_node *node)
{
node->ctdb->num_connected--;
+ node->flags &= ~NODE_FLAGS_CONNECTED;
DEBUG(1,("%s: node %s is dead: %d connected\n",
node->ctdb->name, node->name, node->ctdb->num_connected));
}
static void ctdb_node_connected(struct ctdb_node *node)
{
node->ctdb->num_connected++;
+ node->flags |= NODE_FLAGS_CONNECTED;
DEBUG(1,("%s: connected to %s - %d connected\n",
node->ctdb->name, node->name, node->ctdb->num_connected));
}
ctdb = talloc_zero(ev, struct ctdb_context);
ctdb->ev = ev;
+ ctdb->recovery_mode = CTDB_RECOVERY_NORMAL;
ctdb->upcalls = &ctdb_upcalls;
ctdb->idr = idr_init(ctdb);
ctdb->max_lacount = CTDB_DEFAULT_MAX_LACOUNT;