1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

merge from ronnie

(This used to be ctdb commit 985d718e03510398b9a5cfdf6a4d559a90738a11)
This commit is contained in:
Andrew Tridgell 2007-05-19 17:21:58 +10:00
commit d549f1e1a3
3 changed files with 9 additions and 7 deletions

View File

@ -380,11 +380,12 @@ static void ctdb_recv_pkt(struct ctdb_context *ctdb, uint8_t *data, uint32_t len
/*
called by the transport layer when a node is dead
*/
static void ctdb_node_dead(struct ctdb_node *node)
void ctdb_node_dead(struct ctdb_node *node)
{
node->ctdb->num_connected--;
node->flags &= ~NODE_FLAGS_CONNECTED;
node->rx_cnt = 0;
node->dead_count = 0;
DEBUG(1,("%s: node %s is dead: %d connected\n",
node->ctdb->name, node->name, node->ctdb->num_connected));
ctdb_daemon_cancel_controls(node->ctdb, node);
@ -393,9 +394,10 @@ static void ctdb_node_dead(struct ctdb_node *node)
/*
called by the transport layer when a node is connected
*/
static void ctdb_node_connected(struct ctdb_node *node)
void ctdb_node_connected(struct ctdb_node *node)
{
node->ctdb->num_connected++;
node->dead_count = 0;
node->flags |= NODE_FLAGS_CONNECTED;
DEBUG(1,("%s: connected to %s - %d connected\n",
node->ctdb->name, node->name, node->ctdb->num_connected));

View File

@ -43,8 +43,8 @@ static void ctdb_check_for_dead_nodes(struct event_context *ev, struct timed_eve
/* it might have come alive again */
if (!(node->flags & NODE_FLAGS_CONNECTED) && node->rx_cnt != 0) {
DEBUG(0,("Node %u is alive again - marking as connected\n", node->vnn));
node->flags |= NODE_FLAGS_CONNECTED;
ctdb_node_connected(node);
continue;
}
if (node->rx_cnt == 0) {
@ -56,9 +56,7 @@ static void ctdb_check_for_dead_nodes(struct event_context *ev, struct timed_eve
node->rx_cnt = 0;
if (node->dead_count >= CTDB_MONITORING_DEAD_COUNT) {
DEBUG(0,("Node %u is dead - marking as not connected\n", node->vnn));
node->flags &= ~NODE_FLAGS_CONNECTED;
ctdb_daemon_cancel_controls(ctdb, node);
ctdb_node_dead(node);
/* maybe tell the transport layer to kill the
sockets as well?
*/

View File

@ -826,5 +826,7 @@ void ctdb_send_keepalive(struct ctdb_context *ctdb, uint32_t destnode);
void ctdb_daemon_cancel_controls(struct ctdb_context *ctdb, struct ctdb_node *node);
void ctdb_call_resend_all(struct ctdb_context *ctdb);
void ctdb_node_dead(struct ctdb_node *node);
void ctdb_node_connected(struct ctdb_node *node);
#endif