Bug 2158804

Summary: pcs should validate the type of stonith-watchdog-timeout value based on OCF1.1 format of metadata
Product: Red Hat Enterprise Linux 8 Reporter: Nina Hostakova <nhostako>
Component: pcsAssignee: Miroslav Lisik <mlisik>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.8CC: cluster-maint, cluster-qe, idevat, mlisik, mmazoure, mpospisi, omular, tojeline
Target Milestone: rcKeywords: Triaged
Target Release: 8.8   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcs-0.10.15-3.el8 Doc Type: No Doc Update
Doc Text:
The affected packages have not been released.
Story Points: ---
Clone Of: 2158790 Environment:
Last Closed: 2023-05-16 08:12:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2158790    
Bug Blocks:    

Description Nina Hostakova 2023-01-06 16:06:45 UTC
+++ This bug was initially created as a clone of Bug #2158790 +++

Description of problem:
The metadata for 'stonith-watchdog-timeout' property states that it supports time values. However, a time value cannot be set for this property.

Version-Release number of selected component (if applicable):
pcs-0.10.15-1.el8

Actual results:
# /usr/libexec/pacemaker/pacemaker-controld metadata | grep -A3 stonith-watchdog-timeout
    <parameter name="stonith-watchdog-timeout">
      <longdesc lang="en">If this is set to a positive value, lost nodes are assumed to self-fence using watchdog-based SBD within this much time. This does not require a fencing resource to be explicitly configured, though a fence_watchdog resource can be configured, to limit use to specific nodes. If this is set to 0 (the default), the cluster will never assume watchdog-based self-fencing. If this is set to a negative value, the cluster will use twice the local value of the `SBD_WATCHDOG_TIMEOUT` environment variable if that is positive, or otherwise treat this as 0. WARNING: When used, this timeout must be larger than `SBD_WATCHDOG_TIMEOUT` on all nodes that use watchdog-based SBD, and Pacemaker will refuse to start on any of those nodes where this is not true for the local value or SBD is not active. When this is set to a negative value, `SBD_WATCHDOG_TIMEOUT` must be set to the same value on all nodes that use SBD, otherwise data corruption or loss could occur.</longdesc>
      <shortdesc lang="en">How long before nodes can be assumed to be safely down when watchdog-based self-fencing via SBD is in use</shortdesc>
      <content type="time" default="0"/>

# pcs property set stonith-watchdog-timeout=6s
Error: The stonith-watchdog-timeout must be greater than SBD watchdog timeout '5', entered '6s', use --force to override
Error: Errors have occurred, therefore pcs is unable to continue


Expected results:
pcs can validate time values prior to other validations specific to this property

Additional info:
bz2019464 comment 11

Comment 2 Miroslav Lisik 2023-01-13 08:44:07 UTC
Upstream patch: https://github.com/ClusterLabs/pcs/commit/1f3aa3afb8723abd46d79d0b9c75cc5bc1846146

Test:
Environment: Cluster with enabled watchdog-only sbd

(pcs) [root@r8-node-01 pcs]# pcs property set stonith-watchdog-timeout="invalid"
Error: 'invalid' is not a valid stonith-watchdog-timeout value, use time interval (e.g. 1, 2s, 3m, 4h, ...)
Error: Errors have occurred, therefore pcs is unable to continue

(pcs) [root@r8-node-01 pcs]# pcs property set stonith-watchdog-timeout="10s"
(pcs) [root@r8-node-01 pcs]# pcs property config stonith-watchdog-timeout
Cluster Properties:
 stonith-watchdog-timeout: 10s

(pcs) [root@r8-node-01 pcs]# pcs property set stonith-watchdog-timeout="10"
(pcs) [root@r8-node-01 pcs]# pcs property config stonith-watchdog-timeout
Cluster Properties:
 stonith-watchdog-timeout: 10

(pcs) [root@r8-node-01 pcs]# pcs property set stonith-watchdog-timeout="4s"
Error: The stonith-watchdog-timeout must be greater than SBD watchdog timeout '5', entered '4s', use --force to override
Error: Errors have occurred, therefore pcs is unable to continue
(pcs) [root@r8-node-01 pcs]# pcs property config stonith-watchdog-timeout
Cluster Properties:
 stonith-watchdog-timeout: 10

Comment 3 Michal Pospisil 2023-01-16 15:50:22 UTC
DevTestResults:

[root@r08-08-a pcs]# pcs property set stonith-watchdog-timeout="invalid"
Error: 'invalid' is not a valid stonith-watchdog-timeout value, use time interval (e.g. 1, 2s, 3m, 4h, ...)
Error: Errors have occurred, therefore pcs is unable to continue

[root@r08-08-a pcs]# pcs property set stonith-watchdog-timeout="10s"

[root@r08-08-a pcs]# pcs property config stonith-watchdog-timeout
Cluster Properties:
stonith-watchdog-timeout: 10s

[root@r08-08-a pcs]# pcs property set stonith-watchdog-timeout="10"

[root@r08-08-a pcs]# pcs property config stonith-watchdog-timeout
Cluster Properties:
stonith-watchdog-timeout: 10

[root@r08-08-a pcs]# pcs property set stonith-watchdog-timeout="4s"
Error: The stonith-watchdog-timeout must be greater than SBD watchdog timeout '5', entered '4s', use --force to override
Error: Errors have occurred, therefore pcs is unable to continue

[root@r08-08-a pcs]# pcs property config stonith-watchdog-timeout
Cluster Properties:
stonith-watchdog-timeout: 10

Comment 10 errata-xmlrpc 2023-05-16 08:12:43 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 (pcs 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/RHBA-2023:2738