You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by is...@apache.org on 2019/12/17 18:57:19 UTC
[lucene-solr] branch jira/solr14089 updated: Fixing DZUP's DBQ,
cutting over two tests
This is an automated email from the ASF dual-hosted git repository.
ishan pushed a commit to branch jira/solr14089
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/jira/solr14089 by this push:
new b8559b6 Fixing DZUP's DBQ, cutting over two tests
b8559b6 is described below
commit b8559b6909bc8361568a1ba758f176de9db737b3
Author: Ishan Chattopadhyaya <is...@apache.org>
AuthorDate: Wed Dec 18 00:26:16 2019 +0530
Fixing DZUP's DBQ, cutting over two tests
Cutting over ConfigSetsAPITest, CustomCollectionTest
---
.../apache/solr/update/processor/DistributedZkUpdateProcessor.java | 4 ++--
solr/core/src/test/org/apache/solr/cloud/ConfigSetsAPITest.java | 2 +-
.../org/apache/solr/cloud/api/collections/CustomCollectionTest.java | 4 ++++
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java b/solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java
index ffa0a23..98336db 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/DistributedZkUpdateProcessor.java
@@ -405,7 +405,7 @@ public class DistributedZkUpdateProcessor extends DistributedUpdateProcessor {
String sliceName = slice.getName();
Replica leader;
try {
- leader = zkController.getZkStateReader().getLeaderRetry(collection, sliceName);
+ leader = zkController.getZkStateReader().getShardStateProvider(collection).getLeader(collection, sliceName, -1);
} catch (InterruptedException e) {
throw new SolrException(SolrException.ErrorCode.SERVICE_UNAVAILABLE, "Exception finding leader for shard " + sliceName, e);
}
@@ -530,7 +530,7 @@ public class DistributedZkUpdateProcessor extends DistributedUpdateProcessor {
String shardId = cloudDesc.getShardId();
try {
- Replica leaderReplica = zkController.getZkStateReader().getLeaderRetry(collection, shardId);
+ Replica leaderReplica = zkController.getZkStateReader().getShardStateProvider(collection).getLeader(collection, shardId, -1);
isLeader = leaderReplica.getName().equals(cloudDesc.getCoreNodeName());
// TODO: what if we are no longer the leader?
diff --git a/solr/core/src/test/org/apache/solr/cloud/ConfigSetsAPITest.java b/solr/core/src/test/org/apache/solr/cloud/ConfigSetsAPITest.java
index b749134..f3e8649 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ConfigSetsAPITest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ConfigSetsAPITest.java
@@ -34,7 +34,7 @@ public class ConfigSetsAPITest extends SolrCloudTestCase {
@Test
public void testConfigSetDeleteWhenInUse() throws Exception {
- CollectionAdminRequest.createCollection("test_configset_delete", "conf1", 1, 1)
+ CollectionAdminRequest.createCollection("test_configset_delete", "conf1", 1, 1).setExternalState(true)
.processAndWait(cluster.getSolrClient(), DEFAULT_TIMEOUT);
// TODO - check exception response!
diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/CustomCollectionTest.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/CustomCollectionTest.java
index b295a1f..247e5b6 100644
--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/CustomCollectionTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/CustomCollectionTest.java
@@ -64,6 +64,7 @@ public class CustomCollectionTest extends SolrCloudTestCase {
int maxShardsPerNode = (((numShards + 1) * replicationFactor) / NODE_COUNT) + 1;
CollectionAdminRequest.createCollectionWithImplicitRouter(collection, "conf", "a,b,c", replicationFactor)
+ .setExternalState(true)
.setMaxShardsPerNode(maxShardsPerNode)
.process(cluster.getSolrClient());
@@ -132,6 +133,7 @@ public class CustomCollectionTest extends SolrCloudTestCase {
final String collection = "withShardField";
CollectionAdminRequest.createCollectionWithImplicitRouter(collection, "conf", "a,b,c,d", replicationFactor)
+ .setExternalState(true)
.setMaxShardsPerNode(maxShardsPerNode)
.setRouterField(shard_fld)
.process(cluster.getSolrClient());
@@ -158,6 +160,7 @@ public class CustomCollectionTest extends SolrCloudTestCase {
String shard_fld = "shard_s";
CollectionAdminRequest.createCollection(collectionName, "conf", numShards, replicationFactor)
+ .setExternalState(true)
.setMaxShardsPerNode(maxShardsPerNode)
.setRouterField(shard_fld)
.process(cluster.getSolrClient());
@@ -189,6 +192,7 @@ public class CustomCollectionTest extends SolrCloudTestCase {
public void testCreateShardRepFactor() throws Exception {
final String collectionName = "testCreateShardRepFactor";
CollectionAdminRequest.createCollectionWithImplicitRouter(collectionName, "conf", "a,b", 1)
+ .setExternalState(true)
.process(cluster.getSolrClient());
CollectionAdminRequest.createShard(collectionName, "x")