You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2016/12/15 23:00:51 UTC

[25/50] [abbrv] incubator-impala git commit: IMPALA-4588: Enable starting the minicluster when offline

IMPALA-4588: Enable starting the minicluster when offline

IMPALA-4553 made ntp-wait succeed before kudu would start, assuming
ntp-wait was installed, in order to prevent a litany of errors on ec2
about unsynchronized clocks. This patch disables that waiting if no
internet connection is detected in order to make it possible to start
the minicluster when offline.

Change-Id: Ifbb5babebb0ca6d2553be1b001e20e2270e052b6
Reviewed-on: http://gerrit.cloudera.org:8080/5412
Reviewed-by: Jim Apple <jb...@apache.org>
Tested-by: Impala Public Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/84ee4042
Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/84ee4042
Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/84ee4042

Branch: refs/heads/hadoop-next
Commit: 84ee40428dbb18146760adec8c5a03559f527ddb
Parents: 1762dd1
Author: Jim Apple <jb...@apache.org>
Authored: Wed Dec 7 17:41:41 2016 -0800
Committer: Impala Public Jenkins <im...@gerrit.cloudera.org>
Committed: Fri Dec 9 03:04:07 2016 +0000

----------------------------------------------------------------------
 testdata/cluster/admin | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/84ee4042/testdata/cluster/admin
----------------------------------------------------------------------
diff --git a/testdata/cluster/admin b/testdata/cluster/admin
index ee424ff..785c515 100755
--- a/testdata/cluster/admin
+++ b/testdata/cluster/admin
@@ -293,12 +293,19 @@ function start_cluster {
 
   if [ ${#SUPPORTED_SERVICES[@]} -gt 0 ]; then
     for SERVICE in ${SUPPORTED_SERVICES[@]-}; do
-      # We only run ntp-wait when it is available. That availability is checked by the
-      # call to ntp-wait --help.
-      if [[ "${SERVICE}" == "kudu" ]] && ntp-wait --help >/dev/null 2>/dev/null \
-           && ! ntp-wait -v; then
-        echo "ntp-wait failed; cannot start kudu"
-        return 1
+      # If all of the following are true, we wait for ntp to sync before proceeding:
+      #
+      # 1. Kudu is being started
+      # 2. An internet connection is available (checked by pinging $NTP_CANARY)
+      # 3. ntp-wait is installed (checked by calling ntp-wait with the "--help" flag)
+      if [[ "${SERVICE}" == "kudu" ]]; then
+        NTP_CANARY=pool.ntp.org
+        if ! ping -c 1 -w 5 "${NTP_CANARY}" >/dev/null 2>/dev/null; then
+          echo "WARNING: cannot reach ${NTP_CANARY}; ntp sync recommended for Kudu"
+        elif ntp-wait --help >/dev/null 2>/dev/null && ! ntp-wait -v; then
+          echo "ntp-wait failed; cannot start kudu"
+          return 1
+        fi
       fi
       start $SERVICE
     done