asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mb...@apache.org
Subject asterixdb git commit: [NO ISSUE][CLUS] Don't refresh state from SHUTDOWN
Date Tue, 26 Sep 2017 16:01:42 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master 62cdcc253 -> a181e1353


[NO ISSUE][CLUS] Don't refresh state from SHUTDOWN

- ZK initial state is UNUSABLE

Change-Id: I396374545582dc6a382881dbd5a44d0dabb00224
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2020
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Murtadha Hubail <mhubail@apache.org>


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

Branch: refs/heads/master
Commit: a181e1353533f91bdabe99cddeeea26913a93ccb
Parents: 62cdcc2
Author: Michael Blow <michael.blow@couchbase.com>
Authored: Thu Sep 21 22:23:15 2017 -0400
Committer: Michael Blow <mblow@apache.org>
Committed: Tue Sep 26 09:01:17 2017 -0700

----------------------------------------------------------------------
 .../org/apache/asterix/common/api/IClusterManagementWork.java    | 1 -
 .../org/apache/asterix/event/service/ClusterStateWatcher.java    | 2 +-
 .../org/apache/asterix/runtime/utils/ClusterStateManager.java    | 4 ++++
 3 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/a181e135/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/api/IClusterManagementWork.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/api/IClusterManagementWork.java
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/api/IClusterManagementWork.java
index e3424ec..8bc6eb0 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/api/IClusterManagementWork.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/api/IClusterManagementWork.java
@@ -26,7 +26,6 @@ public interface IClusterManagementWork {
     }
 
     enum ClusterState {
-        STARTING,       // the initial state
         UNUSABLE,       // one or more cluster partitions are inactive or max id resources
have not been reported
         PENDING,        // the metadata node has not yet joined & initialized
         RECOVERING,     // global recovery has not yet completed

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/a181e135/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/service/ClusterStateWatcher.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/service/ClusterStateWatcher.java
b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/service/ClusterStateWatcher.java
index f823404..c51e2cf 100644
--- a/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/service/ClusterStateWatcher.java
+++ b/asterixdb/asterix-events/src/main/java/org/apache/asterix/event/service/ClusterStateWatcher.java
@@ -29,7 +29,7 @@ public class ClusterStateWatcher implements Watcher {
     private final ZooKeeper zk;
     private String clusterStatePath;
     private boolean done = false;
-    private ClusterState clusterState = ClusterState.STARTING;
+    private ClusterState clusterState = ClusterState.UNUSABLE;
     private boolean failed = false;
     private Exception failureCause = null;
     private static Logger LOGGER = Logger.getLogger(ClusterStateWatcher.class.getName());

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/a181e135/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 334b683..51c87b4 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
@@ -165,6 +165,10 @@ public class ClusterStateManager implements IClusterStateManager {
 
     @Override
     public synchronized void refreshState() throws HyracksDataException {
+        if (state == ClusterState.SHUTTING_DOWN) {
+            LOGGER.log(Level.INFO, "Not refreshing final state %s", state);
+            return;
+        }
         resetClusterPartitionConstraint();
         if (clusterPartitions.isEmpty()) {
             LOGGER.info("Cluster does not have any registered partitions");


Mime
View raw message