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

`pcs constraint location config resources` shows constraint with expired rule [rhel-10]

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • rhel-10.0
    • rhel-9.4
    • pcs
    • pcs-0.12.0~b1-1.el10
    • None
    • Low
    • 05c3344ae636f6c673a643c13aa4c993a66ecb4a
    • rhel-sst-high-availability
    • ssg_filesystems_storage_and_HA
    • 13
    • 23
    • 3
    • False
    • Hide

      None

      Show
      None
    • Yes
    • Red Hat Enterprise Linux
    • None
    • Bug Fix
    • Hide
      Cause (the user action or circumstances that trigger the bug):
      Pcs command `pcs constraint location config resources` displays also constraints with expired rules.

      Consequence (what the user experience is when the bug occurs):
      Constraints with expired rules are displayed in the listing.

      Fix (what has changed to fix the bug; do not include overly technical details):
      Constraints with expired rules are filtered out if option '--all' is not specified.

      Result (what happens now that the patch is applied):
      Pcs command `pcs constraint location config resources` does not display constraints with expired rules in the constraint listing unless option '--all' is specified.
      Show
      Cause (the user action or circumstances that trigger the bug): Pcs command `pcs constraint location config resources` displays also constraints with expired rules. Consequence (what the user experience is when the bug occurs): Constraints with expired rules are displayed in the listing. Fix (what has changed to fix the bug; do not include overly technical details): Constraints with expired rules are filtered out if option '--all' is not specified. Result (what happens now that the patch is applied): Pcs command `pcs constraint location config resources` does not display constraints with expired rules in the constraint listing unless option '--all' is specified.
    • Proposed
    • x86_64
    • None

      .Please provide the package NVR for which bug is seen:

      pcs-0.11.7-2.el9_4.x86_64

      How reproducible:

      easily

      Steps to reproduce:

      • setup a cluster
      • create resources with location constraint, one with expired and one with active rule:
          # pcs resource create dummy1 ocf:pacemaker:Dummy
          # pcs resource create dummy2 ocf:pacemaker:Dummy
          # pcs constraint location dummy1 rule score='-INFINITY' date lt '1999-01-01'
          # pcs constraint location dummy2 rule score='-INFINITY' date lt '2025-01-01'
           
      • check location constraint config:
          # pcs constraint location config resources
          Location Constraints:
            Resource: dummy1
              Constraint:
                Rules:
                  Rule (expired): score=-INFINITY
                    Expression: date lt 1999-01-01
            Resource: dummy2
              Constraint:
                Rules:
                  Rule: score=-INFINITY
                    Expression: date lt 2025-01-01
      

      Expected results:

      Only active location constraint is displayed.

      Actual results:

      Expired location constraint is displayed as well. I expected to see the expired constraints only when using `pcs constraint location config --all`

      Additional info:

      When I try to use both `resources` and `nodes` parameters, I don't get any warning that it is not supported and parameter `nodes` is just ignored.

          # pcs resource create dummy3 ocf:pacemaker:Dummy
          # pcs constraint location dummy3 prefers virt-504='1000' virt-507='1005'
          # pcs constraint location config resources dummy3 nodes virt-504
          Location Constraints:
            Resource: dummy3
              Prefers:
                node 'virt-504' with score 1000
                node 'virt-507' with score 1005
          
          # pcs constraint location config nodes virt-504
          Location Constraints:
            Node: virt-504
              Preferred by:
                resource 'dummy3' with score 1000
      

      There is also an inconsistency in output formatting `Resource: dummy2` vs `resource 'dummy2'`. Please see details below.

          # pcs constraint location config resources dummy2
          Location Constraints:
            Resource: dummy2
              Constraint:
                Rules:
                  Rule: score=-INFINITY
                    Expression: date lt 2025-01-01
      
          # pcs constraint location config --all
          Location Constraints:
            resource 'dummy1'
              Rules:
                Rule (expired): score=-INFINITY
                  Expression: date lt 1999-01-01
            resource 'dummy2'
              Rules:
                Rule: score=-INFINITY
                  Expression: date lt 2025-01-01
      

              cluster-qe Cluster QE
              rhn-support-msmazova Marketa Smazova
              Tomas Jelinek Tomas Jelinek
              Nina Hostakova Nina Hostakova
              Steven Levine Steven Levine
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

                Created:
                Updated: