You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by db...@apache.org on 2016/02/09 21:17:18 UTC

[1/2] incubator-trafodion git commit: TRAFODION-1757 Improvements to DCS infrastructure: 1. handle partially up and operational Trafodion environment.

Repository: incubator-trafodion
Updated Branches:
  refs/heads/master 93f104591 -> 8c955e6df


TRAFODION-1757 Improvements to DCS infrastructure:
1. handle partially up and operational Trafodion environment.

2. If zookeeper interface gives an error during dcsstop,
then explicitly kill the DCS master and servers.


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

Branch: refs/heads/master
Commit: c654a51499db500d2f5eea33bdfb8a106870964a
Parents: 3aef621
Author: Arvind Narain <ar...@apache.org>
Authored: Mon Feb 8 23:21:27 2016 +0000
Committer: Arvind Narain <ar...@apache.org>
Committed: Mon Feb 8 23:21:27 2016 +0000

----------------------------------------------------------------------
 core/sqf/sql/scripts/dcscheck                        | 10 +++++-----
 core/sqf/sql/scripts/dcsstart                        |  4 ++--
 dcs/bin/stop-dcs.sh                                  |  5 +++--
 .../java/org/trafodion/dcs/server/ServerManager.java | 15 ++++++++++++++-
 4 files changed, 24 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c654a514/core/sqf/sql/scripts/dcscheck
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/dcscheck b/core/sqf/sql/scripts/dcscheck
index 270a5d6..b0bc689 100755
--- a/core/sqf/sql/scripts/dcscheck
+++ b/core/sqf/sql/scripts/dcscheck
@@ -51,10 +51,10 @@ if [[ $? != 0 ]]; then
 fi
 
 echo
-#Check if Trafodion is up and running
+#Check if Trafodion is up and operational
 sqcheck -f > $tmp_chk 2>&1
 sq_stat=$?
-if [[ $sq_stat == 0 ]]; then
+if ( [ $sq_stat == 0 ] || [ $sq_stat == 1 ] ); then
 
  if [ -d $DCS_INSTALL_DIR ];then
 
@@ -126,8 +126,8 @@ if [[ $sq_stat == 0 ]]; then
      down_dcsmaster_cnt=''
    fi
 
-### Get the current process status (all processes)
-  sqps > $tmp_ps 2>&1
+### Get the current cluster process status (all processes)
+  cstat > $tmp_ps 2>&1
 
 ### Get the actual number of mxosrvrs
   let act_mxo_cnt=`< $tmp_ps egrep -a -i ' mxosrvr' | wc -l`
@@ -181,7 +181,7 @@ if [[ $sq_stat == 0 ]]; then
    exit 1
  fi
 else
- echo "Trafodion is not started..."
+ echo "Trafodion is not started or is not operational..."
  echo
 fi
 exit 0

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c654a514/core/sqf/sql/scripts/dcsstart
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/dcsstart b/core/sqf/sql/scripts/dcsstart
index 5bb6140..86d7d3a 100755
--- a/core/sqf/sql/scripts/dcsstart
+++ b/core/sqf/sql/scripts/dcsstart
@@ -22,10 +22,10 @@
 # @@@ END COPYRIGHT @@@
 #
 
-#Check if Trafodion is up and running
+#Check if Trafodion is up and operational
 sqcheck -f
 sq_stat=$?
-if [[ $sq_stat == 0 ]]; then
+if ( [ $sq_stat == 0 ] || [ $sq_stat == 1 ] ); then
    DCS_START_CMD=${DCS_INSTALL_DIR}/bin/start-dcs.sh
 
    if [ -z ${DCS_INSTALL_DIR} ]; then

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c654a514/dcs/bin/stop-dcs.sh
----------------------------------------------------------------------
diff --git a/dcs/bin/stop-dcs.sh b/dcs/bin/stop-dcs.sh
index 8da9ad4..3259117 100755
--- a/dcs/bin/stop-dcs.sh
+++ b/dcs/bin/stop-dcs.sh
@@ -40,9 +40,10 @@ fi
 
 master=`$bin/dcs --config "${DCS_CONF_DIR}" org.trafodion.dcs.zookeeper.ZkUtil /$USER/dcs/master|tail -n 1`
 errCode=$?
-if [ $errCode -ne 0 ]
+zkerror=`echo $master| grep -i error`
+if ( [ $errCode -ne 0 ] || [ ! -z $zkerror ] );
 then
-  echo "Zookeeper exception occured, killing all DcsMaster and DcsServers..."
+  echo "Zookeeper exception occurred, killing all DcsMaster and DcsServers..."
   "$bin"/dcs-daemon.sh --config "${DCS_CONF_DIR}" stop master 
   "$bin"/dcs-daemons.sh --config "${DCS_CONF_DIR}" --hosts "${DCS_SERVERS}" stop server 
   exit $errCode

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c654a514/dcs/src/main/java/org/trafodion/dcs/server/ServerManager.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/server/ServerManager.java b/dcs/src/main/java/org/trafodion/dcs/server/ServerManager.java
index a275356..b5e65a1 100644
--- a/dcs/src/main/java/org/trafodion/dcs/server/ServerManager.java
+++ b/dcs/src/main/java/org/trafodion/dcs/server/ServerManager.java
@@ -251,6 +251,18 @@ public final class ServerManager implements Callable {
         }
 
         private boolean isTrafodionRunning() {
+
+        // Check if Trafodion is up and running
+        // If Trafodion is fully or partially up and operational 
+        // return true else return false.
+        // Invoke sqcheck to check Trafodion status. 
+        // 
+        //   sqcheck returns:
+        //   -1 - Not up ($?=255)
+        //    0 - Fully up and operational
+        //    1 - Partially up and operational
+        //    2 - Partially up and NOT operational
+
             ScriptContext scriptContext = new ScriptContext();
             scriptContext.setHostName(hostName);
             scriptContext.setScriptName(Constants.SYS_SHELL_SCRIPT_NAME);
@@ -260,7 +272,8 @@ public final class ServerManager implements Callable {
                                                                  // block while
                                                                  // script is
                                                                  // running
-            return scriptContext.getExitCode() != 0 ? false : true;
+            int exitCode = scriptContext.getExitCode();
+            return (exitCode == 0 || exitCode == 1) ? true : false;
         }
     }
 


[2/2] incubator-trafodion git commit: Merge [TRAFODION-1757] PR 312 Improvements to DCS infrastructure

Posted by db...@apache.org.
Merge [TRAFODION-1757] PR 312 Improvements to DCS infrastructure


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/8c955e6d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/8c955e6d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/8c955e6d

Branch: refs/heads/master
Commit: 8c955e6df898925bd1cc13d9c0a663b323f71816
Parents: 93f1045 c654a51
Author: Dave Birdsall <db...@apache.org>
Authored: Tue Feb 9 20:16:41 2016 +0000
Committer: Dave Birdsall <db...@apache.org>
Committed: Tue Feb 9 20:16:41 2016 +0000

----------------------------------------------------------------------
 core/sqf/sql/scripts/dcscheck                        | 10 +++++-----
 core/sqf/sql/scripts/dcsstart                        |  4 ++--
 dcs/bin/stop-dcs.sh                                  |  5 +++--
 .../java/org/trafodion/dcs/server/ServerManager.java | 15 ++++++++++++++-
 4 files changed, 24 insertions(+), 10 deletions(-)
----------------------------------------------------------------------