Index: libdlm/group/dlm_controld/pacemaker.c =================================================================== --- libdlm.orig/group/dlm_controld/pacemaker.c +++ libdlm/group/dlm_controld/pacemaker.c @@ -55,7 +55,6 @@ void close_cluster_cfg(void) {} extern int ais_fd_async; -int local_node_id = 0; char *local_node_uname = NULL; void dlm_process_node(gpointer key, gpointer value, gpointer user_data); @@ -84,7 +83,7 @@ void update_cluster(void) cluster_quorate = crm_have_quorum; if(last_membership < crm_peer_seq) { log_debug("Processing membership %llu", crm_peer_seq); - g_hash_table_foreach(crm_peer_cache, dlm_process_node, &last_membership); + g_hash_table_foreach(crm_peer_id_cache, dlm_process_node, &last_membership); last_membership = crm_peer_seq; } } @@ -148,12 +147,6 @@ void dlm_process_node(gpointer key, gpoi action = "Added"; } - if(local_node_id == 0) { - crm_node_t *local_node = g_hash_table_lookup( - crm_peer_cache, local_node_uname); - local_node_id = local_node->id; - } - do { char ipaddr[1024]; int addr_family = AF_INET; @@ -204,16 +197,16 @@ void dlm_process_node(gpointer key, gpoi continue; } - log_debug("Adding address %s to configfs for node %u/%s ", addr, node->id, node->uname); - add_configfs_node(node->id, ((char*)&cna_addr), cna_len, (node->id == local_node_id)); + log_debug("Adding address %s to configfs for node %u", addr, node->id); + add_configfs_node(node->id, ((char*)&cna_addr), cna_len, (node->id == our_nodeid)); } while(addr != NULL); free(addr_top); } - log_debug("%s %sctive node %u '%s': born-on=%llu, last-seen=%llu, this-event=%llu, last-event=%llu", + log_debug("%s %sctive node %u: born-on=%llu, last-seen=%llu, this-event=%llu, last-event=%llu", action, crm_is_member_active(value)?"a":"ina", - node->id, node->uname, node->born, node->last_seen, + node->id, node->born, node->last_seen, crm_peer_seq, (unsigned long long)*last); } @@ -251,13 +244,13 @@ void kick_node_from_cluster(int nodeid) } switch(rc) { - case 0: + case 1: log_debug("Requested that node %d be kicked from the cluster", nodeid); break; case -1: log_error("Don't know how to kick node %d from the cluster", nodeid); break; - case 1: + case 0: log_error("Could not kick node %d from the cluster", nodeid); break; default: @@ -327,6 +320,8 @@ int fence_in_progress(int *in_progress) int fence_node_time(int nodeid, uint64_t *last_fenced_time) { int rc = 0; + static time_t last_log = 0; + xmlNode *xpath_data; char xpath_query[XPATH_MAX]; crm_node_t *node = crm_get_peer(nodeid, NULL); @@ -351,11 +346,21 @@ int fence_node_time(int nodeid, uint64_t if(xpath_data == NULL) { /* the node has been shot - return 'now' */ - log_debug("Node %d/%s was last shot 'now'", nodeid, node->uname); + log_level(LOG_INFO, "Node %d/%s was last shot 'now'", nodeid, node->uname); *last_fenced_time = time(NULL); + last_log = 0; + + } else { + time_t now = time(NULL); + if(last_log == 0) { + log_level(LOG_INFO, "Node %d/%s has not been shot yet", nodeid, node->uname); + + } else if(now - last_log > 30) { + log_level(LOG_DEBUG, "Node %d/%s has still not been shot yet", nodeid, node->uname); + } + last_log = now; } free_xml(xpath_data); - log_debug("It does not appear node %d/%s has been shot", nodeid, node->uname); return 0; }