hiteshk25 commented on code in PR #1350:
URL: https://github.com/apache/solr/pull/1350#discussion_r1105161959


##########
solr/core/src/test/org/apache/solr/cloud/SplitShardWithNodeRoleTest.java:
##########
@@ -0,0 +1,91 @@
+package org.apache.solr.cloud;
+
+import java.util.Locale;
+import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.request.CollectionAdminRequest;
+import org.apache.solr.client.solrj.request.UpdateRequest;
+import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.core.NodeRoles;
+import org.apache.solr.embedded.JettySolrRunner;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class SplitShardWithNodeRoleTest extends SolrCloudTestCase {
+  @BeforeClass
+  public static void setupCluster() throws Exception {
+    configureCluster(2).addConfig("conf", 
configset("cloud-minimal")).configure();
+    System.setProperty(NodeRoles.NODE_ROLES_PROP, "data:off,coordinator:on");
+
+    try {
+      cluster.startJettySolrRunner();
+      cluster.startJettySolrRunner();
+    } finally {
+      System.clearProperty(NodeRoles.NODE_ROLES_PROP);
+    }
+
+    JettySolrRunner overseer1 = null;
+    JettySolrRunner overseer2 = null;
+    System.setProperty(NodeRoles.NODE_ROLES_PROP, 
"data:off,overseer:preferred");
+    try {
+      overseer1 = cluster.startJettySolrRunner();
+      overseer2 = cluster.startJettySolrRunner();
+    } finally {
+      System.clearProperty(NodeRoles.NODE_ROLES_PROP);
+    }
+
+    Thread.sleep(10000);

Review Comment:
   Right, My attempt to listen zk node `overseer_elect` was too complex as 
child `leader` was deleted on each update. 
   
   if there is any pattern let me know?



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to