crm_attribute Error Cleanup
Closed this issue · 2 comments
dotmanila commented
When the agent checks for any attribute and there was none set, it returns an error and is quite confusing from the logfile/syslog when enabled. In many cases, we can make this better by using the --default option of crm_attribute and changing the following checks for results.
++ /usr/sbin/crm_attribute -N maindb03.boardreader.com -q -l reboot --name p_mysql_master_crashed --query
Error performing operation: No such device or address
For example, when mysql_monitor is invoked with meta role == Master it triggers this code:
# Is this following a recent master crash?
master_crashed_ts=`$CRM_ATTR_MASTER_CRASHED_TS --query`
if [ ! -z $master_crashed_ts ]; then
if [ `date +%s` -gt "$((${master_crashed_ts}+3600))" ]; then
#Let's cleanup the cib
$CRM_ATTR_MASTER_CRASHED_TS -D
$CRM_ATTR_LAST_TRX -D
fi
fi
We can change it to:
# Is this following a recent master crash?
master_crashed_ts=`$CRM_ATTR_MASTER_CRASHED_TS --query --default=0`
if [ "$master_crashed_ts" -gt "0" ]; then
if [ `date +%s` -gt "$((${master_crashed_ts}+3600))" ]; then
#Let's cleanup the cib
$CRM_ATTR_MASTER_CRASHED_TS -D
$CRM_ATTR_LAST_TRX -D
fi
fi
grypyrg commented
+1
y-trudeau commented
not merged directly but integrated in 1.0.0-beta