Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP1:Update
pacemaker.29834
bsc#1205861-0002-Fix-Use-effective-OCF-rc-code-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bsc#1205861-0002-Fix-Use-effective-OCF-rc-code-to-avoid-increasing-fa.patch of Package pacemaker.29834
From 23246ba3a87b3318dda43c82f8f7fb6b8146d05a Mon Sep 17 00:00:00 2001 From: Oyvind Albrigtsen <oalbrigt@redhat.com> Date: Thu, 24 Sep 2020 14:05:39 +0200 Subject: [PATCH] Fix: Use effective OCF rc-code to avoid increasing failcount for DEGRADED statuses --- daemons/controld/controld_te_events.c | 2 ++ include/crm/common/internal.h | 3 +++ lib/common/agents.c | 21 +++++++++++++++++++++ 3 files changed, 26 insertions(+) Index: pacemaker-2.0.1+20190417.13d370ca9/daemons/controld/controld_te_events.c =================================================================== --- pacemaker-2.0.1+20190417.13d370ca9.orig/daemons/controld/controld_te_events.c +++ pacemaker-2.0.1+20190417.13d370ca9/daemons/controld/controld_te_events.c @@ -465,6 +465,8 @@ process_graph_event(xmlNode *event, cons return; } + rc = pcmk__effective_rc(rc); + if (decode_transition_key(magic, &update_te_uuid, &transition_num, &action_num, &target_rc) == FALSE) { crm_err("Invalid event %s.%d detected: %s", id, callid, magic); Index: pacemaker-2.0.1+20190417.13d370ca9/include/crm/common/internal.h =================================================================== --- pacemaker-2.0.1+20190417.13d370ca9.orig/include/crm/common/internal.h +++ pacemaker-2.0.1+20190417.13d370ca9/include/crm/common/internal.h @@ -169,4 +169,7 @@ crm_lastfailure_name(const char *rsc_id, return crm_fail_attr_name(CRM_LAST_FAILURE_PREFIX, rsc_id, op, interval_ms); } +// internal resource agent functions (from agents.c) +int pcmk__effective_rc(int rc); + #endif /* CRM_COMMON_INTERNAL__H */ Index: pacemaker-2.0.1+20190417.13d370ca9/lib/common/agents.c =================================================================== --- pacemaker-2.0.1+20190417.13d370ca9.orig/lib/common/agents.c +++ pacemaker-2.0.1+20190417.13d370ca9/lib/common/agents.c @@ -64,6 +64,27 @@ pcmk_get_ra_caps(const char *standard) return pcmk_ra_cap_none; } +int +pcmk__effective_rc(int rc) +{ + int remapped_rc = rc; + + switch (rc) { + case PCMK_OCF_DEGRADED: + remapped_rc = PCMK_OCF_OK; + break; + + case PCMK_OCF_DEGRADED_MASTER: + remapped_rc = PCMK_OCF_RUNNING_MASTER; + break; + + default: + break; + } + + return remapped_rc; +} + char * crm_generate_ra_key(const char *standard, const char *provider, const char *type)
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