This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1471506 - ocf:pacemaker:ClusterMon do not use "update" attribute
ocf:pacemaker:ClusterMon do not use "update" attribute
Status: ON_QA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pacemaker (Show other bugs)
7.3
x86_64 Linux
medium Severity low
: rc
: 7.5
Assigned To: Ken Gaillot
cluster-qe@redhat.com
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-16 09:44 EDT by Strahil Nikolov
Modified: 2017-10-10 13:48 EDT (History)
4 users (show)

See Also:
Fixed In Version: pacemaker-1.1.18-1.el7
Doc Type: Bug Fix
Doc Text:
Cause: The meta-data for the ocf:pacemaker:ClusterMon resource agent incorrectly implied the "update" option used seconds (instead of milliseconds) as its units. Consequence: Users might configure the "update" option with a value less than 1000, which would be ignored. Fix: The meta-data now correctly specifies that the "update" units are in milliseconds. Additionally, the resource agent will interpret any values less than 1000 as seconds. Result: Users are clearly directed to use milliseconds as "update" units, and resources previously configured with the expectation of seconds as units now work properly.
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Strahil Nikolov 2017-07-16 09:44:12 EDT
Description of problem:
The "ocf:pacemaker:ClusterMon" resource accepts the "update" attribute, but never uses it.It even ignores the default and starts crm_mon with "-i 0" instead.

Version-Release number of selected component (if applicable):
pacemaker-cli-1.1.15-11.el7_3.5.x86_64

How reproducible:
Always

Steps to Reproduce:

1.Create a Cloned Monitor resource:
#pcs resource create MONITOR ClusterMon user="root"  update="30" \
extra_options="-r" htmlfile="/var/log/clustermon" --clone

2.Check the crm_mon deamon's parameters:
# ps -aux | grep [c]rm_mon
# grep [c]ontent /var/log/clustermon


3.Deamon is stated as follows:
"usr/sbin/crm_mon -p /tmp/ClusterMon_MONITOR.pid -d -i 0 -r -h /var/log/clustermon"
HTML file has refresh rate of "0"

Actual results:
crm_mon stated with "-i 0"
HTML file has same refresh rate of 0:
<meta http-equiv="refresh" content="0">

Expected results:
crm_mon to use value from "update" attribute of the resource - in my case "-i 30"
And the refresh rate in the html file to be the same value:
<meta http-equiv="refresh" content="30">

Additional info:
# pcs resource show MONITOR
 Resource: MONITOR (class=ocf provider=pacemaker type=ClusterMon)
  Attributes: user=root update=30 extra_options=-r htmlfile=/var/log/clustermon
  Operations: start interval=0s timeout=20 (MONITOR-start-interval-0s)
              stop interval=0s timeout=20 (MONITOR-stop-interval-0s)
              monitor interval=10 timeout=20 (MONITOR-monitor-interval-10)
Comment 2 Strahil Nikolov 2017-07-16 09:48:11 EDT
Update:
Recreating the resource without the "update" attribute - takes the default of "-i 15" and the refresh rate is defined as:
<meta http-equiv="refresh" content="15">
Comment 3 Andrew Beekhof 2017-07-16 20:35:50 EDT
Looks like the agent's metadata is wrong. The value should be in milliseconds because it does:

: ${OCF_RESKEY_update:="15000"}

OCF_RESKEY_update=`expr $OCF_RESKEY_update / 1000`

CMON_CMD="${HA_SBIN_DIR}/crm_mon -p $OCF_RESKEY_pidfile -d -i $OCF_RESKEY_update $OCF_RESKEY_extra_options -h $OCF_RESKEY_htmlfile"

which explains why '30' is functioning as '0'
Comment 4 Ken Gaillot 2017-07-17 09:43:19 EDT
I'll update the metadata for 7.5. Values less than 1000 will currently be ignored anyway, so I'll also change it to treat the value as seconds if it's below 1000 and milliseconds otherwise.
Comment 5 Ken Gaillot 2017-07-18 19:40:52 EDT
Fixed upstream as of commit 02c294df

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