CaoManhDat commented on a change in pull request #1167: SOLR-13845: 
DELETEREPLICA API by count and type
URL: https://github.com/apache/lucene-solr/pull/1167#discussion_r381005466
 
 

 ##########
 File path: solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java
 ##########
 @@ -170,6 +170,58 @@ public void deleteReplicaAndVerifyDirectoryCleanup() 
throws Exception {
     assertFalse("DataDirectory still exists", 
Files.exists(Paths.get(coreStatus.getDataDirectory())));
   }
 
+  @Test
+  public void deleteReplicaByCountWithType() throws Exception {
+
+    final String collectionName = "deleteByCountWithType";
+
+    Create req = CollectionAdminRequest.createCollection(collectionName, 
"conf", 1, 2, 0, 2);
+    req.setMaxShardsPerNode(2);
+    req.process(cluster.getSolrClient());
+    waitForState("Expected a single shard with six replicas", collectionName, 
clusterShape(1, 4));
+
+    CollectionAdminRequest.deleteReplicasFromShard(collectionName, "shard1", 
1, Replica.Type.NRT).process(cluster.getSolrClient());
+    waitForState("Expected a single shard with a single NRT replica", 
collectionName, clusterShape(1, 1, Replica.Type.NRT));
+    waitForState("Expected a single shard with two PULL replicas", 
collectionName, clusterShape(1, 2, Replica.Type.PULL));
+
+    CollectionAdminRequest.deleteReplicasFromShard(collectionName, "shard1", 
2, Replica.Type.PULL).process(cluster.getSolrClient());
+    waitForState("Expected a single shard with a single PULL replica", 
collectionName, clusterShape(1, 0, Replica.Type.PULL));
 
 Review comment:
   I think this message is not correct, we are expecting a shard with 0 pull 
replica

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to