Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-131916

Incorrect Secondary Node Scoring in Mixed SAP HANA + Multistate Clusters

Linking RHIVOS CVEs to...Migration: Automation ...RHELPRIO AssignedTeam ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhel-9.6
    • sap-hana-ha
    • None
    • None
    • None
    • rhel-sst-sap
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      When using SAPHanaSR-showAttr in a Pacemaker cluster that has both: * a SAP HANA controller resource (SAPHanaController), and

      • an additional multi-state firewall resource that also uses master-rsc_* node attributes,

      the secondary controller node score is reported incorrectly.

      crm_mon -A -D -1 shows the correct scores (150 for the promoted master controller, 100 for the healthy demoted secondary), but SAPHanaSR-showAttr displays 5 for the healthy secondary instead of 100.

      This appears to be caused by pattern matching in saphana_sr_tools.py that matches all master-rsc_SID_* attributes, including those created by the firewall resource, and then treating them as controller scores.
       
      Current State:
      Cluster configuration (simplified): * Controller resource name:

      •  rsc_SAPHanaController_A23_HDB00 (type SAPHanaController, class ocf, provider heartbeat)
      • Additional firewall resource (multi-state), used to avoid split-brain/racing conditions:
      •  rsc_firewall_A23_HDB00
      • The firewall resource is also promotable and sets node attributes of the form:
      •  master-rsc_firewall_A23_HDB00

      Node attributes example (for node syz1bab3dbn01):
       

      Node Attributes:
        * Node: syz1bab3dbn01:
          * hana_a23_clone_state              : DEMOTED
          * hana_a23_roles                    : master1:master:worker:master
          * hana_a23_site                     : AB3AZ1
          * hana_a23_sra                      : -
          * hana_a23_srah                     : -
          * hana_a23_version                  : 2.00.079.02
          * hana_a23_vhost                    : syz1bab3dbn01
          * master-rsc_SAPHanaController_A23_HDB00    : 100
          * master-rsc_firewall_A23_HDB00             : 5

       
      Behaviour of the tools: * crm_mon -A -D -1

      • Shows correct controller scores:
          • 150 for the healthy/promoted master controller
        • 100 for the healthy demoted secondary
      • SAPHanaSR-showAttr
        • Shows 150 for the promoted master/controller (correct)
        • Shows only 5 for the healthy secondary (incorrect – should be 100)

      Suspected root cause is in saphana_sr_tools.py (lines 79–81 in upstream at the time of writing):

      # TODO: Do we need to check, if the master-attribute belongs to the promotable clone for this SID?
      match_obj = re.search(f"master.rsc.*_{sid_uc}_.*", column_name)   # (4)
      if match_obj is not None:
          column_name = 'score'
      return column_name 

      This code is imported and used by SAPHanaSR-showAttr (import on line 28).
       Because the regex is very broad, both of these attributes match: * master-rsc_SAPHanaController_A23_HDB00

      • master-rsc_firewall_A23_HDB00

      so the firewall’s 5 is effectively being used where the controller’s 100 should be reported.
       
      Expected Outcome: * SAPHanaSR-showAttr should only interpret controller-related node attributes as the score for the SAP HANA controller resource, and ignore unrelated master-rsc_* attributes from other promotable resources (like the firewall).

      • For the example above, SAPHanaSR-showAttr should:
        • Report 150 for the promoted master/controller
        • Report 100 for the healthy secondary controller
        • Not be affected by the master-rsc_firewall_A23_HDB00 : 5 attribute

       
      Additional Notes / Possible Direction for Fix
      A naïve workaround would be to hard-code the controller resource pattern, for example:
       

      match_obj = re.search(f"master-rsc_SAPHanaController_{sid_uc}_.*", column_name) 

      However, a better long-term fix would be to: * Find the name of the resource correlating with the LRM resource list such as:

      •  <lrm_resource id="rsc_SAPHanaController_A23_HDB00" type="SAPHanaController" class="ocf" provider="heartbeat">), and use a specific resource name without hardcoding the naming convention

              jfuchs@redhat.com Janine Fuchs
              rhn-support-musman Muhammad Usman
              Janine Fuchs Janine Fuchs
              Amir Memon Amir Memon
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: