You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by cp...@apache.org on 2017/05/30 11:28:18 UTC

[09/25] lucene-solr:jira/solr-8668: SOLR-10233: Correctly set maxShardsPerNode in BackupRestoreTestCase when using createNodeSet and replica types

SOLR-10233: Correctly set maxShardsPerNode in BackupRestoreTestCase when using createNodeSet and replica types


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

Branch: refs/heads/jira/solr-8668
Commit: 8f92fb4722709bec34b4c0330afb7cabba86e350
Parents: 9fbc9db
Author: Tomas Fernandez Lobbe <tf...@apache.org>
Authored: Fri May 26 14:49:18 2017 -0700
Committer: Tomas Fernandez Lobbe <tf...@apache.org>
Committed: Fri May 26 14:49:18 2017 -0700

----------------------------------------------------------------------
 .../apache/solr/cloud/AbstractCloudBackupRestoreTestCase.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8f92fb47/solr/core/src/test/org/apache/solr/cloud/AbstractCloudBackupRestoreTestCase.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/AbstractCloudBackupRestoreTestCase.java b/solr/core/src/test/org/apache/solr/cloud/AbstractCloudBackupRestoreTestCase.java
index a6d130e..f86322d 100644
--- a/solr/core/src/test/org/apache/solr/cloud/AbstractCloudBackupRestoreTestCase.java
+++ b/solr/core/src/test/org/apache/solr/cloud/AbstractCloudBackupRestoreTestCase.java
@@ -244,6 +244,7 @@ public abstract class AbstractCloudBackupRestoreTestCase extends SolrCloudTestCa
         // may need to increase maxShardsPerNode (e.g. if it was shard split, then now we need more)
         restore.setMaxShardsPerNode((int)Math.ceil(backupCollection.getReplicas().size()/cluster.getJettySolrRunners().size()));
       }
+      
 
       if (rarely()) { // Try with createNodeSet configuration
         int nodeSetSize = cluster.getJettySolrRunners().size() / 2;
@@ -255,7 +256,11 @@ public abstract class AbstractCloudBackupRestoreTestCase extends SolrCloudTestCa
         restore.setCreateNodeSet(String.join(",", nodeStrs));
         restore.setCreateNodeSetShuffle(usually());
         // we need to double maxShardsPerNode value since we reduced number of available nodes by half.
-        restore.setMaxShardsPerNode(origShardToDocCount.size() * 2);
+        if (restore.getMaxShardsPerNode() != null) {
+          restore.setMaxShardsPerNode(restore.getMaxShardsPerNode() * 2);
+        } else {
+          restore.setMaxShardsPerNode(origShardToDocCount.size() * 2);
+        }
       }
 
       Properties props = new Properties();