hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-14462 rolling_restart.sh --master-only throws "line 142: test: 0: unary operator expected" (Samir Ahmic)
Date Tue, 01 Dec 2015 18:29:08 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 3534e1ffe -> ed4e00119


HBASE-14462 rolling_restart.sh --master-only throws "line 142: test: 0: unary operator expected"
(Samir Ahmic)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/ed4e0011
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/ed4e0011
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/ed4e0011

Branch: refs/heads/master
Commit: ed4e00119ec43bb9e8fb3d9b37878b4d1dfb8e71
Parents: 3534e1f
Author: tedyu <yuzhihong@gmail.com>
Authored: Tue Dec 1 10:28:56 2015 -0800
Committer: tedyu <yuzhihong@gmail.com>
Committed: Tue Dec 1 10:28:56 2015 -0800

----------------------------------------------------------------------
 bin/rolling-restart.sh | 34 +++++++++++++++++++++++-----------
 1 file changed, 23 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/ed4e0011/bin/rolling-restart.sh
----------------------------------------------------------------------
diff --git a/bin/rolling-restart.sh b/bin/rolling-restart.sh
index fb43967..ffebd0b 100755
--- a/bin/rolling-restart.sh
+++ b/bin/rolling-restart.sh
@@ -116,6 +116,7 @@ else
     if [ "$zmaster" == "null" ]; then zmaster="master"; fi
     zmaster=$zparent/$zmaster
     echo -n "Waiting for Master ZNode ${zmaster} to expire"
+    echo
     while ! "$bin"/hbase zkcli stat $zmaster 2>&1 | grep "Node does not exist"; do
       echo -n "."
       sleep 1
@@ -136,17 +137,28 @@ else
     zunassigned=`$bin/hbase org.apache.hadoop.hbase.util.HBaseConfTool zookeeper.znode.unassigned`
     if [ "$zunassigned" == "null" ]; then zunassigned="region-in-transition"; fi
     zunassigned="$zparent/$zunassigned"
-    echo -n "Waiting for ${zunassigned} to empty"
-    while true ; do
-      unassigned=`$bin/hbase zkcli stat ${zunassigned} 2>&1 |grep -e 'numChildren
= '|sed -e 's,numChildren = ,,'`
-      if test 0 -eq ${unassigned}
-      then
-        break
-      else
-        echo -n " ${unassigned}"
-      fi
-      sleep 1
-    done
+    # Checking if /hbase/region-in-transition exist
+    ritZnodeCheck=`$bin/hbase zkcli stat ${zunassigned} 2>&1 | tail -1 \
+		  | grep "Node does not exist:" >/dev/null`
+    ret=$?
+    if test 0 -eq ${ret}
+    then
+      echo "Znode ${zunassigned} does not exist"
+    else
+      echo -n "Waiting for ${zunassigned} to empty"
+      while true ; do
+        unassigned=`$bin/hbase zkcli stat ${zunassigned} 2>&1 \
+		   | grep -e 'numChildren = '|sed -e 's,numChildren = ,,'`
+        if test 0 -eq ${unassigned}
+        then
+          echo
+          break
+        else
+          echo -n " ${unassigned}"
+        fi
+        sleep 1
+      done
+    fi
   fi
 
   if [ $RR_RS -eq 1 ]; then


Mime
View raw message