Skip to content

CLOUDSTACK-10296: Find time different from last timestamp - #2458

Merged
yadvr merged 4 commits into
apache:4.11from
shapeblue:rvr-heartbeat-fix
Mar 15, 2018
Merged

CLOUDSTACK-10296: Find time different from last timestamp#2458
yadvr merged 4 commits into
apache:4.11from
shapeblue:rvr-heartbeat-fix

Conversation

@yadvr

@yadvr yadvr commented Feb 16, 2018

Copy link
Copy Markdown
Member

This fixes a difference issue in rVR heartbeat check script raised
recently on dev@.

@blueorangutan package

@yadvr yadvr added this to the 4.11.1 milestone Feb 16, 2018
@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1725

@DaanHoogland DaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in line with the report; positive time 👍

@wido

wido commented Feb 21, 2018

Copy link
Copy Markdown
Contributor

Code LGTM

@apache apache deleted a comment from blueorangutan Feb 25, 2018
@apache apache deleted a comment from borisstoyanov Feb 25, 2018
@apache apache deleted a comment from blueorangutan Feb 25, 2018
@apache apache deleted a comment from blueorangutan Feb 25, 2018
@yadvr

yadvr commented Feb 25, 2018

Copy link
Copy Markdown
Member Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@yadvr

yadvr commented Feb 26, 2018

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1735

@yadvr

yadvr commented Feb 26, 2018

Copy link
Copy Markdown
Member Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@ustcweizhou

Copy link
Copy Markdown
Contributor

We met the issue several times on our production.
the final change is

diff --git a/systemvm/patches/debian/config/opt/cloud/templates/check_heartbeat.sh.templ b/systemvm/patches/debian/config/opt/cloud/templates/check_heartbeat.sh.templ
index 6a0d8a9..a8ddc7d 100755
--- a/systemvm/patches/debian/config/opt/cloud/templates/check_heartbeat.sh.templ
+++ b/systemvm/patches/debian/config/opt/cloud/templates/check_heartbeat.sh.templ
@@ -19,14 +19,29 @@
 ROUTER_BIN_PATH=/ramdisk/rrouter
 ROUTER_LOG=${ROUTER_BIN_PATH}/keepalived.log
 STRIKE_FILE="$ROUTER_BIN_PATH/keepalived.strikes"
+CHECKTIME_FILE="$ROUTER_BIN_PATH/keepalived.checktime"

 if [ -e $ROUTER_BIN_PATH/keepalived.ts2 ]
 then
     thistime=$(cat $ROUTER_BIN_PATH/keepalived.ts)
     lasttime=$(cat $ROUTER_BIN_PATH/keepalived.ts2)
-    diff=$(($lasttime - $thistime))
+    diff=$(($thistime - $lasttime))
+    lastcheck=0
+    if [ -e $CHECKTIME_FILE ]
+    then
+        lastcheck=`cat $CHECKTIME_FILE 2>/dev/null`
+    fi
+    thischeck=$(date +%s)
+    checkdiff=$(($thischeck - $lastcheck))
+    echo "thischeck: $thischeck, lastcheck: $lastcheck. this heartbeat: $thistime, last heartbeat: $lasttime, time diff: $diff" >> $ROUTER_LOG
+    if [ $checkdiff -ge 0 ] && [ $checkdiff -lt 30 ]
+    then
+        echo time duration after last check is less than 30 seconds, ignored >> $ROUTER_LOG
+        exit
+    fi
+    echo $thischeck > $CHECKTIME_FILE
     s=0
-    if [ $diff -ge 10 ]
+    if [ $diff -lt 30 ]
     then
         if [ -e $STRIKE_FILE ]
         then

@yadvr

yadvr commented Feb 27, 2018

Copy link
Copy Markdown
Member Author

Trillian env has been failing due to this change. Thanks for sharing @ustcweizhou, let me apply and test your fix.
@blueorangutan package

This fixes a difference issue in rVR heartbeat check script raised
recently on dev@.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
…not running

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@yadvr
yadvr force-pushed the rvr-heartbeat-fix branch from d8c7e55 to 4ae83cc Compare February 28, 2018 14:36
@yadvr

yadvr commented Feb 28, 2018

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1745

@yadvr

yadvr commented Feb 28, 2018

Copy link
Copy Markdown
Member Author

@blueorangutan test

@apache apache deleted a comment from blueorangutan Feb 28, 2018
@apache apache deleted a comment from blueorangutan Feb 28, 2018
@apache apache deleted a comment from blueorangutan Feb 28, 2018
@apache apache deleted a comment from blueorangutan Feb 28, 2018
@apache apache deleted a comment from blueorangutan Feb 28, 2018
@blueorangutan

Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-2299)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 35592 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2458-t2299-kvm-centos7.zip
Intermitten failure detected: /marvin/tests/smoke/test_privategw_acl.py
Intermitten failure detected: /marvin/tests/smoke/test_public_ip_range.py
Intermitten failure detected: /marvin/tests/smoke/test_templates.py
Intermitten failure detected: /marvin/tests/smoke/test_usage.py
Intermitten failure detected: /marvin/tests/smoke/test_volumes.py
Intermitten failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Smoke tests completed. 62 look OK, 5 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_03_vpc_privategw_restart_vpc_cleanup Failure 151.60 test_privategw_acl.py
test_04_extract_template Failure 128.27 test_templates.py
ContextSuite context=TestISOUsage>:setup Error 0.00 test_usage.py
test_06_download_detached_volume Failure 139.67 test_volumes.py
test_04_rvpc_network_garbage_collector_nics Failure 514.94 test_vpc_redundant.py

@yadvr

yadvr commented Mar 13, 2018

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✖debian. JID-1769

@yadvr

yadvr commented Mar 13, 2018

Copy link
Copy Markdown
Member Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-2352)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 24890 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2458-t2352-kvm-centos7.zip
Intermitten failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Intermitten failure detected: /marvin/tests/smoke/test_hostha_kvm.py
Smoke tests completed. 65 look OK, 2 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_04_rvpc_network_garbage_collector_nics Failure 516.31 test_vpc_redundant.py
test_hostha_enable_ha_when_host_in_maintenance Error 1.78 test_hostha_kvm.py

@yadvr

yadvr commented Mar 15, 2018

Copy link
Copy Markdown
Member Author

Merging this based on test results and review LGTMs.

@yadvr
yadvr merged commit ab0bce2 into apache:4.11 Mar 15, 2018
@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✖debian. JID-1778

@DaanHoogland

Copy link
Copy Markdown
Contributor

wow, blueorangutan came back with a stale package result after merge! need more oil in the machine, something got stuck

@yadvr

yadvr commented Mar 15, 2018

Copy link
Copy Markdown
Member Author

No @DaanHoogland it's the trigger that is sometimes caused by github that kicks these pkging jobs post merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants