Skip to content

Commit

Permalink
Fix: crmd: clear failure only for requested node
Browse files Browse the repository at this point in the history
The PE schedules CRM_OP_CLEAR_FAILCOUNT operations to clear a particular resource on a
particular node. When the operation was introduced in a2b997c, the crmd never checked
the node, but always cleared fail-count and last-failure for all nodes.

Commit 42316ba attempted to use the node name, but checked the wrong XML parent
for the information. This commit corrects that.
  • Loading branch information
kgaillot committed Feb 23, 2017
1 parent c339a4c commit 8830b6f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions crmd/messages.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,19 +623,23 @@ handle_failcount_op(xmlNode * stored_msg)
const char *rsc = NULL;
const char *uname = NULL;
gboolean is_remote_node = FALSE;
xmlNode *xml_rsc = get_xpath_object("//" XML_CIB_TAG_RESOURCE, stored_msg, LOG_ERR);
xmlNode *xml_op = get_message_xml(stored_msg, F_CRM_DATA);

if (xml_rsc) {
rsc = ID(xml_rsc);
if (xml_op) {
xmlNode *xml_rsc = first_named_child(xml_op, XML_CIB_TAG_RESOURCE);

if (xml_rsc) {
rsc = ID(xml_rsc);
}
}

if (rsc == NULL) {
crm_log_xml_warn(stored_msg, "invalid failcount op");
return I_NULL;
}

uname = crm_element_value(stored_msg, XML_LRM_ATTR_TARGET);
if (crm_element_value(stored_msg, XML_LRM_ATTR_ROUTER_NODE)) {
uname = crm_element_value(xml_op, XML_LRM_ATTR_TARGET);
if (crm_element_value(xml_op, XML_LRM_ATTR_ROUTER_NODE)) {
is_remote_node = TRUE;
}
update_attrd_clear_failures(uname, rsc, is_remote_node);
Expand Down

0 comments on commit 8830b6f

Please sign in to comment.