lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject [49/50] [abbrv] lucene-solr:feature/autoscaling: Merge remote-tracking branch 'origin/feature/autoscaling' into feature/autoscaling
Date Wed, 07 Jun 2017 14:11:53 GMT
Merge remote-tracking branch 'origin/feature/autoscaling' into feature/autoscaling

# Conflicts:
#	solr/core/src/java/org/apache/solr/cloud/ZkController.java
#	solr/core/src/test/org/apache/solr/cloud/autoscaling/TestPolicyCloud.java


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

Branch: refs/heads/feature/autoscaling
Commit: d3b5adfd62c4e3c27937671a6a2ee9f42665b1c8
Parents: 2d54025 8bc7c47
Author: Shalin Shekhar Mangar <shalin@apache.org>
Authored: Wed Jun 7 19:09:24 2017 +0530
Committer: Shalin Shekhar Mangar <shalin@apache.org>
Committed: Wed Jun 7 19:09:24 2017 +0530

----------------------------------------------------------------------
 .../org/apache/solr/cloud/ZkController.java     | 101 +++++--
 .../cloud/autoscaling/AutoScalingConfig.java    | 146 ++++++++++
 .../cloud/autoscaling/NodeAddedTrigger.java     |  45 ++-
 .../solr/cloud/autoscaling/NodeLostTrigger.java |  41 ++-
 .../autoscaling/OverseerTriggerThread.java      |  52 +++-
 .../cloud/autoscaling/ScheduledTriggers.java    |  10 +-
 .../solr/cloud/autoscaling/TriggerBase.java     |   8 +-
 .../autoscaling/TriggerIntegrationTest.java     | 272 +++++++++++++++++--
 .../solr/common/cloud/LiveNodesListener.java    |  38 +++
 .../apache/solr/common/cloud/ZkStateReader.java |  32 ++-
 10 files changed, 681 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d3b5adfd/solr/core/src/java/org/apache/solr/cloud/ZkController.java
----------------------------------------------------------------------
diff --cc solr/core/src/java/org/apache/solr/cloud/ZkController.java
index 086c150,54514ba..de41871
--- a/solr/core/src/java/org/apache/solr/cloud/ZkController.java
+++ b/solr/core/src/java/org/apache/solr/cloud/ZkController.java
@@@ -917,9 -962,7 +970,9 @@@ public class ZkController 
        String ourUrl = ZkCoreNodeProps.getCoreUrl(baseUrl, coreName);
        log.debug("We are " + ourUrl + " and leader is " + leaderUrl);
        boolean isLeader = leaderUrl.equals(ourUrl);
 -      
 +      Replica.Type replicaType =  zkStateReader.getClusterState().getCollection(collection).getReplica(coreZkNodeName).getType();
 +      assert !(isLeader && replicaType == Type.PULL): "Pull replica became leader!";
-       
++
        try (SolrCore core = cc.getCore(desc.getName())) {
          
          // recover from local transaction log and wait for it to complete before
@@@ -962,7 -1006,6 +1015,7 @@@
            publish(desc, Replica.State.ACTIVE);
          }
          
-         
++
          core.getCoreDescriptor().getCloudDescriptor().setHasRegistered(true);
        }
        
@@@ -1296,15 -1329,13 +1349,15 @@@
        assert false : "No collection was specified [" + collection + "]";
        return;
      }
 +    Replica replica = zkStateReader.getClusterState().getReplica(collection, coreNodeName);
-     
+ 
 -    ElectionContext context = electionContexts.remove(new ContextKey(collection, coreNodeName));
 +    if (replica == null || replica.getType() != Type.PULL) {
 +      ElectionContext context = electionContexts.remove(new ContextKey(collection, coreNodeName));
  
 -    if (context != null) {
 -      context.cancelElection();
 +      if (context != null) {
 +        context.cancelElection();
 +      }
      }
 -
      CloudDescriptor cloudDescriptor = cd.getCloudDescriptor();
      zkStateReader.unregisterCore(cloudDescriptor.getCollectionName());
  

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d3b5adfd/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
----------------------------------------------------------------------


Mime
View raw message