Blob Blame History Raw
commit e03e4f32fca5857618603e3e1c9500dbf3d348ef
Author: Lars Ellenberg <lars.ellenberg@linbit.com>
Date:   Fri Aug 2 14:33:57 2013 +1000

    Fix: crmd: Don't add node_state to cib, if we have not seen or fenced this node yet
    
    Also fixes the incredibly dangerous option: startup-fencing=false
    
    (cherry picked from commit ac7aa1c94f317fc1d4024fbc09b012bc9f1b229e)

diff --git a/crmd/membership.c b/crmd/membership.c
index e2bcd45..d102db0 100644
--- a/crmd/membership.c
+++ b/crmd/membership.c
@@ -131,8 +131,14 @@ xmlNode *
 do_update_node_cib(crm_node_t * node, int flags, xmlNode * parent, const char *source)
 {
     const char *value = NULL;
-    xmlNode *node_state = create_xml_node(parent, XML_CIB_TAG_STATE);
+    xmlNode *node_state;
 
+    if (!node->state) {
+        crm_info("Node update for %s cancelled: no state, not seen yet", node->uname);
+       return NULL;
+    }
+
+    node_state = create_xml_node(parent, XML_CIB_TAG_STATE);
     set_uuid(node_state, XML_ATTR_UUID, node);
 
     if (crm_element_value(node_state, XML_ATTR_UUID) == NULL) {