-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added simple test to ensure heartbeat_grace_msecs > cluster_lease_tim…
…eout
- Loading branch information
1 parent
aa948c5
commit 93e3af3
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
set -ue # Fail with an error code if there's any sub-command/variable error | ||
|
||
DESCRIPTION="Enforce heartbeat_grace_msec is greater than cluster_lease" | ||
# script type is single, parallel, sequential, or parallel-compare-backends | ||
SCRIPT_TYPE="single" | ||
|
||
RETURN_CODE=0 | ||
|
||
|
||
HB_GRACE_DEFAULT=$( weka debug override list-keys --filter key=heartbeat_grace_msecs --output defaultValue --no-header | head -n1) | ||
CL_TIMEOUT_DEFAULT=$(weka debug override list-keys --filter key=cluster_lease_timeout_msecs --output defaultValue --no-header | head -n1) | ||
HB_GRACE_MANUAL=$( weka debug override list --filter key=heartbeat_grace_msecs --output value --no-header) | ||
CL_TIMEOUT_MANUAL=$( weka debug override list --filter key=cluster_lease_timeout_msecs --output value --no-header) | ||
HB_GRACE=${HB_GRACE_MANUAL:-${HB_GRACE_DEFAULT}} | ||
CL_TIMEOUT=${CL_TIMEOUT_MANUAL:-${CL_TIMEOUT_DEFAULT}} | ||
|
||
# enforce heartbeat_grace_msecs > cluster_lease_timeout_msecs | ||
if [[ ${CL_TIMEOUT} -ge ${HB_GRACE} ]]; then | ||
echo "WARN: cluster_lease_timeout_msecs (${CL_TIMEOUT}) is greater than or equal to heartbeat_grace_msecs (${HB_GRACE})" | ||
echo "This may be because one value has been left at a default, but this configuration" | ||
echo "might prevent cluster status being propagated correctly." | ||
echo "To rectify, ensure that heartbeat_grace_msecs is greater than cluster_lease_timeout_msecs" | ||
RETURN_CODE=254 | ||
fi | ||
|
||
if [[ ${RETURN_CODE} -eq 0 ]]; then | ||
echo "heartbeat_grace_msecs is greater than cluster_lease_timeout_msecs" | ||
fi | ||
|
||
exit ${RETURN_CODE} |