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

This commit is contained in:
Tomas Fernandez Lobbe 2017-05-26 14:49:18 -07:00
parent 9fbc9db1c1
commit 8f92fb4722
1 changed files with 6 additions and 1 deletions

View File

@ -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();