You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by dm...@apache.org on 2019/07/25 16:10:24 UTC

[ambari] branch branch-2.7 updated: AMBARI-25343. Storm Service Check fails during Rolling Upgrade due to… (#3058)

This is an automated email from the ASF dual-hosted git repository.

dmitriusan pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
     new 6fd7ce1  AMBARI-25343. Storm Service Check fails during Rolling Upgrade due to… (#3058)
6fd7ce1 is described below

commit 6fd7ce1a7e580b604b0c6e486e181bf2374b2ac1
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
AuthorDate: Thu Jul 25 19:10:18 2019 +0300

    AMBARI-25343. Storm Service Check fails during Rolling Upgrade due to… (#3058)
    
    * AMBARI-25343. Storm Service Check fails during Rolling Upgrade due to Nimbus leader selection (dlysnichenko)
    
    * AMBARI-25343. Storm Service Check fails during Rolling Upgrade due to Nimbus leader selection - fix import (dlysnichenko)
---
 .../STORM/0.9.1/package/scripts/service_check.py             | 12 +++++++++---
 .../src/test/python/stacks/2.1/STORM/test_service_check.py   |  2 ++
 .../src/test/python/stacks/2.3/STORM/test_service_check.py   |  2 ++
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/service_check.py
index 52f73ed..8d49208 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/service_check.py
+++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/service_check.py
@@ -75,16 +75,22 @@ class ServiceCheckDefault(ServiceCheck):
         storm_client_jaas_file = format("{conf_dir}/client_jaas.conf")
         cmd = format("{kinit_cmd}{cmd} -c java.security.auth.login.config={storm_client_jaas_file}")
 
+    try_count = 1
+    if params.nimbus_hosts and len(params.nimbus_hosts) > 1:
+      try_count = 3
+      print("Nimbus HA is enabled. The check may be retried up to %d times in order to wait for the Nimbus leader selection" % try_count)
     Execute(cmd,
             logoutput=True,
             path=params.storm_bin_dir,
-            user=params.storm_user
-    )
+            user=params.storm_user,
+            try_sleep=30,
+            tries=try_count
+            )
 
     Execute(format("storm kill WordCount{unique}"),
             path=params.storm_bin_dir,
             user=params.storm_user
-    )
+            )
 
 if __name__ == "__main__":
   ServiceCheck().execute()
diff --git a/ambari-server/src/test/python/stacks/2.1/STORM/test_service_check.py b/ambari-server/src/test/python/stacks/2.1/STORM/test_service_check.py
index 799494b..a7708ca 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_service_check.py
@@ -44,6 +44,8 @@ class TestStormServiceCheck(TestStormBase):
     self.assertResourceCalled('Execute', 'storm jar /tmp/wordCount.jar storm.starter.WordCountTopology WordCount -c nimbus.host=c6402.ambari.apache.org',
       logoutput = True,
       path = ['/usr/bin'],
+      tries = 1,
+      try_sleep = 30,
       user = 'storm'
     )
     self.assertResourceCalled('Execute', 'storm kill WordCount',
diff --git a/ambari-server/src/test/python/stacks/2.3/STORM/test_service_check.py b/ambari-server/src/test/python/stacks/2.3/STORM/test_service_check.py
index 47101d2..a29783b 100644
--- a/ambari-server/src/test/python/stacks/2.3/STORM/test_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.3/STORM/test_service_check.py
@@ -43,6 +43,8 @@ class TestStormServiceCheck(TestStormBase):
     self.assertResourceCalled('Execute', 'storm jar /tmp/wordCount.jar storm.starter.WordCountTopology WordCount',
       logoutput = True,
       path = ['/usr/hdp/current/storm-client/bin'],
+      tries = 3,
+      try_sleep = 30,
       user = 'storm'
     )
     self.assertResourceCalled('Execute', 'storm kill WordCount',