lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r1620320 - in /lucene/dev/branches/branch_4x: ./ solr/ solr/core/ solr/core/src/java/org/apache/solr/cloud/ElectionContext.java solr/core/src/test/org/apache/solr/cloud/OverseerTest.java
Date Mon, 25 Aug 2014 13:10:19 GMT
Author: markrmiller
Date: Mon Aug 25 13:10:19 2014
New Revision: 1620320

URL: http://svn.apache.org/r1620320
Log:
SOLR-6428: Occasional OverseerTest#testOverseerFailure fail due to missing election node.
SOLR-5596: OverseerTest.testOverseerFailure - leader node already exists.

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/solr/   (props changed)
    lucene/dev/branches/branch_4x/solr/core/   (props changed)
    lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/cloud/ElectionContext.java
    lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java

Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/cloud/ElectionContext.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/cloud/ElectionContext.java?rev=1620320&r1=1620319&r2=1620320&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/cloud/ElectionContext.java
(original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/cloud/ElectionContext.java
Mon Aug 25 13:10:19 2014
@@ -189,6 +189,11 @@ final class ShardLeaderElectionContext e
     syncStrategy.close();
   }
   
+  @Override
+  public ElectionContext copy() {
+    return new ShardLeaderElectionContext(leaderElector, shardId, collection, id, leaderProps,
zkController, cc);
+  }
+  
   /* 
    * weAreReplacement: has someone else been the leader already?
    */

Modified: lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java?rev=1620320&r1=1620319&r2=1620320&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java
(original)
+++ lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java
Mon Aug 25 13:10:19 2014
@@ -73,7 +73,6 @@ public class OverseerTest extends SolrTe
     private final SolrZkClient zkClient;
     private final ZkStateReader zkStateReader;
     private final String nodeName;
-    private final LeaderElector elector;
     private final Map<String, ElectionContext> electionContext = Collections.synchronizedMap(new
HashMap<String, ElectionContext>());
     
     public MockZKController(String zkAddress, String nodeName) throws InterruptedException,
TimeoutException, IOException, KeeperException {
@@ -85,7 +84,6 @@ public class OverseerTest extends SolrTe
       // live node
       final String nodePath = ZkStateReader.LIVE_NODES_ZKNODE + "/" + nodeName;
       zkClient.makePath(nodePath, CreateMode.EPHEMERAL, true);
-      elector = new LeaderElector(zkClient);
     }
 
     private void deleteNode(final String path) {
@@ -121,7 +119,7 @@ public class OverseerTest extends SolrTe
             ZkStateReader.COLLECTION_PROP, collection);
             DistributedQueue q = Overseer.getInQueue(zkClient);
             q.offer(ZkStateReader.toJSON(m));
-
+         return null;
       } else {
         ZkNodeProps m = new ZkNodeProps(Overseer.QUEUE_OPERATION, "state",
         ZkStateReader.STATE_PROP, stateName,
@@ -150,6 +148,7 @@ public class OverseerTest extends SolrTe
                 ZkStateReader.SHARD_ID_PROP, shardId,
                 ZkStateReader.COLLECTION_PROP, collection,
                 ZkStateReader.CORE_NODE_NAME_PROP, coreNodeName);
+            LeaderElector elector = new LeaderElector(zkClient);
             ShardLeaderElectionContextBase ctx = new ShardLeaderElectionContextBase(
                 elector, shardId, collection, nodeName + "_" + coreName, props,
                 zkStateReader);
@@ -335,9 +334,9 @@ public class OverseerTest extends SolrTe
   public void testShardAssignmentBigger() throws Exception {
     String zkDir = createTempDir("zkData").getAbsolutePath();
 
-    final int nodeCount = random().nextInt(50)+50;   //how many simulated nodes (num of threads)
-    final int coreCount = random().nextInt(100)+100;  //how many cores to register
-    final int sliceCount = random().nextInt(20)+1;  //how many slices
+    final int nodeCount = random().nextInt(TEST_NIGHTLY ? 50 : 10)+(TEST_NIGHTLY ? 50 : 10)+1;
  //how many simulated nodes (num of threads)
+    final int coreCount = random().nextInt(TEST_NIGHTLY ? 100 : 11)+(TEST_NIGHTLY ? 100 :
11)+1; //how many cores to register
+    final int sliceCount = random().nextInt(TEST_NIGHTLY ? 20 : 5)+1;  //how many slices
     
     ZkTestServer server = new ZkTestServer(zkDir);
 



Mime
View raw message