[Pacemaker] Node name problems after upgrading to 1.1.9

Andrew Beekhof andrew at beekhof.net
Fri Jun 28 22:23:54 UTC 2013


On 28/06/2013, at 9:16 PM, Andrew Beekhof <andrew at beekhof.net> wrote:

> 
> On 28/06/2013, at 8:10 PM, Andrew Beekhof <andrew at beekhof.net> wrote:
> 
>> 
>> On 28/06/2013, at 6:42 PM, Bernardo Cabezas Serra <bcabezas at apsl.net> wrote:
>> 
>>> Hello Andrew,
>>> 
>>> El 27/06/13 14:44, Andrew Beekhof escribió:
>>>> You should see additional logs sent to /var/log/pacemaker.log
>>> 
>>> Finally yesterday issue happened again. This time, node "selavi" was DC,
>>> and node "turifel" joined the cluster. Cluster was in status unmanaged.
>>> 
>>> Unfortunately, I have no pacemaker trace logs on selavi, but have it for
>>> turifel.
>> 
>> No good I'm afraid.
>> And they both look heavily filtered.
> 
> Aha! But I seem to be able to produce it on my test cluster.
> I'll enable tracing and see what it turns up.
> 

Fixed:

diff --git a/lib/cluster/membership.c b/lib/cluster/membership.c
index 875c1c8..556c0f4 100644
--- a/lib/cluster/membership.c
+++ b/lib/cluster/membership.c
@@ -178,6 +178,14 @@ static void crm_dump_peer_hash(int level, const char *caller)
     }
 }
 
+static gboolean crm_hash_find_by_data(gpointer key, gpointer value, gpointer user_data)
+{
+    if(value == user_data) {
+        return TRUE;
+    }
+    return FALSE;
+}
+
 /* coverity[-alloc] Memory is referenced in one or both hashtables */
 crm_node_t *
 crm_get_peer(unsigned int id, const char *uname)
@@ -259,7 +267,7 @@ crm_get_peer(unsigned int id, const char *uname)
         crm_dump_peer_hash(LOG_DEBUG, __FUNCTION__);
 
         crm_info("Merging %p into %p", by_name, by_id);
-        g_hash_table_remove(crm_peer_cache, by_name);
+        g_hash_table_foreach_remove(crm_peer_cache, crm_hash_find_by_data, by_name);
     }
 
     if (node == NULL) {





More information about the Pacemaker mailing list