Skip to content

Commit 75c9a20

Browse files
author
Sheng Yang
committed
CLOUDSTACK-6989: Add 3 strikes rule for RvR freezing detection
Sometime in VR ntpd would move time backward to keep sync with NTP server, which can result in false alarm of keepalived monitering process. This patch adds 3 strikes for keepalived process dead detection to avoid falsely shutdown keepalived process due to time adjustment for only once.
1 parent f756d4a commit 75c9a20

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

systemvm/patches/debian/config/root/redundant_router/check_heartbeat.sh.templ

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,27 @@
1717
# under the License.
1818

1919

20+
STRIKE_FILE="[RROUTER_BIN_PATH]/keepalived.strikes"
21+
2022
if [ -e [RROUTER_BIN_PATH]/keepalived.ts2 ]
2123
then
2224
lasttime=$(cat [RROUTER_BIN_PATH]/keepalived.ts2)
2325
thistime=$(cat [RROUTER_BIN_PATH]/keepalived.ts)
2426
diff=$(($thistime - $lasttime))
27+
s=0
2528
if [ $diff -lt 30 ]
29+
then
30+
if [ -e $STRIKE_FILE ]
31+
then
32+
s=`cat $STRIKE_FILE 2>/dev/null`
33+
fi
34+
s=$(($s+1))
35+
echo $s > $STRIKE_FILE
36+
else
37+
rm $STRIKE_FILE
38+
fi
39+
#3 strikes rule
40+
if [ $s -gt 2 ]
2641
then
2742
echo Keepalived process is dead! >> [RROUTER_LOG]
2843
[RROUTER_BIN_PATH]/services.sh stop >> [RROUTER_LOG] 2>&1

0 commit comments

Comments
 (0)