add a new ctdb_ltdb function to delete a record in a normal database
[sahlberg/ctdb.git] / server / ctdb_keepalive.c
index 0047e9cf8a10c30f2634ea18b1ee650edea82c1f..b4899b746f471ce3f4cde40faa22455b98f6178f 100644 (file)
@@ -19,7 +19,7 @@
 */
 
 #include "includes.h"
-#include "lib/events/events.h"
+#include "lib/tevent/tevent.h"
 #include "system/filesys.h"
 #include "system/wait.h"
 #include "../include/ctdb_private.h"
@@ -37,6 +37,11 @@ static void ctdb_check_for_dead_nodes(struct event_context *ev, struct timed_eve
        /* send a keepalive to all other nodes, unless */
        for (i=0;i<ctdb->num_nodes;i++) {
                struct ctdb_node *node = ctdb->nodes[i];
+
+               if (node->flags & NODE_FLAGS_DELETED) {
+                       continue;
+               }
+
                if (node->pnn == ctdb->pnn) {
                        continue;
                }
@@ -59,7 +64,7 @@ static void ctdb_check_for_dead_nodes(struct event_context *ev, struct timed_eve
                node->rx_cnt = 0;
 
                if (node->dead_count >= ctdb->tunable.keepalive_limit) {
-                       DEBUG(0,("dead count reached for node %u\n", node->pnn));
+                       DEBUG(DEBUG_NOTICE,("dead count reached for node %u\n", node->pnn));
                        ctdb_node_dead(node);
                        ctdb_send_keepalive(ctdb, node->pnn);
                        /* maybe tell the transport layer to kill the
@@ -68,10 +73,8 @@ static void ctdb_check_for_dead_nodes(struct event_context *ev, struct timed_eve
                        continue;
                }
                
-               if (node->tx_cnt == 0) {
-                       DEBUG(DEBUG_DEBUG,("sending keepalive to %u\n", node->pnn));
-                       ctdb_send_keepalive(ctdb, node->pnn);
-               }
+               DEBUG(DEBUG_DEBUG,("sending keepalive to %u\n", node->pnn));
+               ctdb_send_keepalive(ctdb, node->pnn);
 
                node->tx_cnt = 0;
        }
@@ -94,7 +97,7 @@ void ctdb_start_keepalive(struct ctdb_context *ctdb)
                             ctdb_check_for_dead_nodes, ctdb);
        CTDB_NO_MEMORY_FATAL(ctdb, te);
 
-       DEBUG(0,("Keepalive monitoring has been started\n"));
+       DEBUG(DEBUG_NOTICE,("Keepalive monitoring has been started\n"));
 }
 
 void ctdb_stop_keepalive(struct ctdb_context *ctdb)