lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject lucene-solr:branch_7x: SOLR-11807: Simply testing of createNodeSet with restoring collection and fixing the test failure
Date Tue, 31 Jul 2018 22:20:23 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_7x 334bf498b -> a0afe4646


SOLR-11807: Simply testing of createNodeSet with restoring collection and fixing the test
failure

(cherry picked from commit c9e3c45)


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

Branch: refs/heads/branch_7x
Commit: a0afe4646f6fe08497a234834b59abc74b4c4208
Parents: 334bf49
Author: Varun Thacker <varun@apache.org>
Authored: Tue Jul 31 14:54:50 2018 -0700
Committer: Varun Thacker <varun@apache.org>
Committed: Tue Jul 31 15:20:09 2018 -0700

----------------------------------------------------------------------
 .../AbstractCloudBackupRestoreTestCase.java       | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a0afe464/solr/core/src/test/org/apache/solr/cloud/api/collections/AbstractCloudBackupRestoreTestCase.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/AbstractCloudBackupRestoreTestCase.java
b/solr/core/src/test/org/apache/solr/cloud/api/collections/AbstractCloudBackupRestoreTestCase.java
index a78be03..17089b8 100644
--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/AbstractCloudBackupRestoreTestCase.java
+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/AbstractCloudBackupRestoreTestCase.java
@@ -20,7 +20,6 @@ import java.io.IOException;
 import java.lang.invoke.MethodHandles;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
@@ -30,7 +29,6 @@ import java.util.TreeMap;
 import org.apache.lucene.util.TestUtil;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.SolrServerException;
-import org.apache.solr.client.solrj.embedded.JettySolrRunner;
 import org.apache.solr.client.solrj.impl.CloudSolrClient;
 import org.apache.solr.client.solrj.impl.HttpSolrClient;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
@@ -294,20 +292,12 @@ public abstract class AbstractCloudBackupRestoreTestCase extends SolrCloudTestCa
     }
 
     if (rarely()) { // Try with createNodeSet configuration
-      List<String> nodeStrs = new ArrayList<>(1);//Always 1 as cluster.getJettySolrRunners().size()=NUM_SHARDS=2
-      Iterator<JettySolrRunner> iter = cluster.getJettySolrRunners().iterator();
-      nodeStrs.add(iter.next().getNodeName());
-      restore.setCreateNodeSet(String.join(",", nodeStrs));
-      restore.setCreateNodeSetShuffle(usually());
+      //Always 1 as cluster.getJettySolrRunners().size()=NUM_SHARDS=2
+      restore.setCreateNodeSet(cluster.getJettySolrRunners().get(0).getNodeName());
       // we need to double maxShardsPerNode value since we reduced number of available nodes
by half.
       isMaxShardsPerNodeExternal = true;
-      if (restore.getMaxShardsPerNode() != null) {
-        computeRestoreMaxShardsPerNode = restore.getMaxShardsPerNode() * 2;
-        restore.setMaxShardsPerNode(computeRestoreMaxShardsPerNode);
-      } else {
-        computeRestoreMaxShardsPerNode = origShardToDocCount.size() * backupReplFactor;
-        restore.setMaxShardsPerNode(origShardToDocCount.size() * backupReplFactor);
-      }
+      computeRestoreMaxShardsPerNode = origShardToDocCount.size() * restoreReplFactor;
+      restore.setMaxShardsPerNode(computeRestoreMaxShardsPerNode);
     }
 
     final int restoreMaxShardsPerNode = computeRestoreMaxShardsPerNode;


Mime
View raw message