RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1790591 - pacemaker does not check constraints with date-spec rules for expiration
Summary: pacemaker does not check constraints with date-spec rules for expiration
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pacemaker
Version: 8.2
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: 8.3
Assignee: Chris Lumens
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-13 16:53 UTC by Nina Hostakova
Modified: 2020-11-04 04:01 UTC (History)
4 users (show)

Fixed In Version: pacemaker-2.0.4-2.el8
Doc Type: No Doc Update
Doc Text:
This is a minor enhancement to an existing capability that was documented previously, so I don't think it needs its own release note.
Clone Of:
Environment:
Last Closed: 2020-11-04 04:00:53 UTC
Type: Enhancement
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Comment 1 Ken Gaillot 2020-01-17 19:36:18 UTC
This limitation was considered acceptable for the initial implementation due to the complexity of date-spec. However, I think we should easily be able to handle cases where "years" is specified, and "moon" is not. We can focus this BZ on that particular case.

For a date-spec without "years", there's really no expiration since it's recurring (monthly or whatever). I think the current behavior is acceptable in that case.

The "moon" option (0-7 where 0 is the new moon and 4 is the full moon) was more of a (somewhat ridiculous) demonstration of what was possible than a useful option. I think for practical reasons, we can leave expiration checking unimplemented when "moon" is used with "years", which hopefully is never. Perhaps we should even deprecate "moon" and eventually remove it.

Comment 2 Chris Lumens 2020-01-24 22:23:45 UTC
This is pretty straightforward.  I'm finishing up a PR now, but want to run it through some additional tests before I send it off for review.  I'm hoping to do that at the beginning of next week.

Comment 3 Chris Lumens 2020-01-27 15:51:22 UTC
https://github.com/ClusterLabs/pacemaker/pull/1982

Comment 4 Ken Gaillot 2020-02-27 21:30:09 UTC
Fixed upstream as of https://github.com/ClusterLabs/pacemaker/pull/1982

Comment 5 Patrik Hagara 2020-03-23 09:01:15 UTC
qa_ack+, reproducer in description

Comment 8 Simon Foucek 2020-08-04 13:54:09 UTC
Tested on a basic 2-node cluster.

Before fix:
>[root@virt-036 ~]# rpm -q pacemaker
>pacemaker-2.0.3-5.el8_2.1.x86_64
>[root@virt-036 ~]# pcs resource create "Dummy" ocf:pacemaker:Dummy
>[root@virt-036 ~]# pcs constraint location Dummy rule date-spec years=2018
>[root@virt-036 ~]# pcs constraint --full | sed "s/^/\[`date +"%Y-%m-%d %H:%M:%S"`] /"
>[2020-08-04 14:42:18] Location Constraints:
>[2020-08-04 14:42:18]   Resource: Dummy
>[2020-08-04 14:42:18]     Constraint: location-Dummy
>[2020-08-04 14:42:18]       Rule: score=INFINITY (id:location-Dummy-rule)
>[2020-08-04 14:42:18]         Expression: (id:location-Dummy-rule-expr)
>[2020-08-04 14:42:18]           Date Spec: years=2018 (id:location-Dummy-rule-expr-datespec)
>[2020-08-04 14:42:18] Ordering Constraints:
>[2020-08-04 14:42:18] Colocation Constraints:
>[2020-08-04 14:42:18] Ticket Constraints:
>[root@virt-036 ~]# crm_rule --check --rule location-Dummy-rule
>No rule found with ID=location-Dummy-rule containing a date_expression
>Error checking rule: No such device or address
>[root@virt-036 ~]# echo $?
>105

Result: Constraints containing date-spec rules are not evaluated so they remain in the constraint list after expiration

After fix:
>[root@virt-128 ~]# rpm -q pacemaker
>pacemaker-2.0.4-5.el8.x86_64
>[root@virt-128 ~]# pcs resource create "Dummy" ocf:pacemaker:Dummy
>[root@virt-128 ~]# pcs constraint location Dummy rule date-spec years=2018
>[root@virt-128 ~]# pcs constraint --full | sed "s/^/\[`date +"%Y-%m-%d %H:%M:%S"`] /"
>[2020-08-04 15:27:41] Location Constraints:
>[2020-08-04 15:27:41] Ordering Constraints:
>[2020-08-04 15:27:41] Colocation Constraints:
>[2020-08-04 15:27:41] Ticket Constraints:
>[root@virt-128 ~]# crm_rule --check --rule location-Dummy-rule
>Rule location-Dummy-rule is expired
>[root@virt-128 ~]# echo $?
>110

Result: Constraints containing date-spec rules are evaluated and they dont remain in the constraint list after expiration.

Comment 11 errata-xmlrpc 2020-11-04 04:00:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (pacemaker bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2020:4804


Note You need to log in before you can comment on or make changes to this bug.