asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mb...@apache.org
Subject asterixdb git commit: Minor cleanup, no PENDING on cluster state refresh
Date Mon, 05 Jun 2017 17:47:52 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master c91e5bb2e -> 2cd936670


Minor cleanup, no PENDING on cluster state refresh

Change-Id: I34221471f9aafa4ae970b2f44f80577ebb8bbba7
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1803
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
BAD: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>


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

Branch: refs/heads/master
Commit: 2cd936670f2aec3607e4d2640f034cafbb7f3bf6
Parents: c91e5bb
Author: Michael Blow <mblow@apache.org>
Authored: Sat Jun 3 23:19:12 2017 -0400
Committer: Michael Blow <mblow@apache.org>
Committed: Mon Jun 5 10:47:32 2017 -0700

----------------------------------------------------------------------
 .../asterix/runtime/utils/ClusterStateManager.java       | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/2cd93667/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java
index 64ef5c2..37b3cc2 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java
@@ -164,17 +164,18 @@ public class ClusterStateManager implements IClusterStateManager {
             }
         }
 
-        setState(ClusterState.PENDING);
-        LOGGER.info("Cluster is now " + state);
-
         // if all storage partitions are active as well as the metadata node, then the cluster
is active
         if (metadataNodeActive) {
+            if (state != ClusterState.ACTIVE) {
+                setState(ClusterState.PENDING);
+            }
             appCtx.getMetadataBootstrap().init();
             setState(ClusterState.ACTIVE);
-            LOGGER.info("Cluster is now " + state);
             notifyAll();
             // start global recovery
             appCtx.getGlobalRecoveryManager().startGlobalRecovery(appCtx);
+        } else {
+            setState(ClusterState.PENDING);
         }
     }
 
@@ -377,7 +378,7 @@ public class ClusterStateManager implements IClusterStateManager {
     public synchronized void deregisterNodePartitions(String nodeId) {
         ClusterPartition [] nodePartitions = node2PartitionsMap.remove(nodeId);
         if (LOGGER.isLoggable(Level.INFO)) {
-            LOGGER.info("Deegistering node partitions for node " + nodeId + ": " + Arrays.toString(nodePartitions));
+            LOGGER.info("Deregistering node partitions for node " + nodeId + ": " + Arrays.toString(nodePartitions));
         }
         for (ClusterPartition nodePartition : nodePartitions) {
             clusterPartitions.remove(nodePartition.getPartitionId());


Mime
View raw message