Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15
pacemaker.26927
bsc#1196340-0004-Refactor-scheduler-is_newer_op...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bsc#1196340-0004-Refactor-scheduler-is_newer_op-to-be-able-to-compare.patch of Package pacemaker.26927
From b74dab4f34fbdba0ae5da05ccd5f921595ab2029 Mon Sep 17 00:00:00 2001 From: "Gao,Yan" <ygao@suse.com> Date: Mon, 9 May 2022 13:38:43 +0200 Subject: [PATCH 4/9] Refactor: scheduler: is_newer_op() to be able to compare lrm_rsc_op entries from different nodes --- lib/pengine/utils.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) Index: pacemaker-2.0.1+20190417.13d370ca9/lib/pengine/utils.c =================================================================== --- pacemaker-2.0.1+20190417.13d370ca9.orig/lib/pengine/utils.c +++ pacemaker-2.0.1+20190417.13d370ca9/lib/pengine/utils.c @@ -1623,7 +1623,11 @@ pe__is_newer_op(const xmlNode *xml_a, co const char *a_xml_id = crm_element_value(xml_a, XML_ATTR_ID); const char *b_xml_id = crm_element_value(xml_b, XML_ATTR_ID); - if (crm_str_eq(a_xml_id, b_xml_id, TRUE)) { + const char *a_node = crm_element_value(xml_a, XML_LRM_ATTR_TARGET); + const char *b_node = crm_element_value(xml_b, XML_LRM_ATTR_TARGET); + bool same_node = safe_str_eq(a_node, b_node); + + if (same_node && crm_str_eq(a_xml_id, b_xml_id, TRUE)) { /* We have duplicate lrm_rsc_op entries in the status * section which is unliklely to be a good thing * - we can handle it easily enough, but we need to get @@ -1642,13 +1646,14 @@ pe__is_newer_op(const xmlNode *xml_a, co */ sort_return(0, "pending"); - } else if (a_call_id >= 0 && a_call_id < b_call_id) { + } else if (same_node && a_call_id >= 0 && a_call_id < b_call_id) { sort_return(-1, "call id"); - } else if (b_call_id >= 0 && a_call_id > b_call_id) { + } else if (same_node && b_call_id >= 0 && a_call_id > b_call_id) { sort_return(1, "call id"); - } else if (b_call_id >= 0 && a_call_id == b_call_id) { + } else if (a_call_id >= 0 && b_call_id >= 0 + && (!same_node || a_call_id == b_call_id)) { /* * The op and last_failed_op are the same * Order on last-rc-change
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor