You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by no...@apache.org on 2023/03/13 02:02:59 UTC

[solr] branch jira/solr16653_4 updated: removed the testcase

This is an automated email from the ASF dual-hosted git repository.

noble pushed a commit to branch jira/solr16653_4
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/jira/solr16653_4 by this push:
     new c53079d4e29 removed the testcase
c53079d4e29 is described below

commit c53079d4e292cd5095d2ce0480246263983168b0
Author: Noble Paul <no...@gmail.com>
AuthorDate: Mon Mar 13 13:02:51 2023 +1100

    removed the testcase
---
 .../apache/solr/cloud/overseer/ReplicaMutator.java | 12 ---
 .../apache/solr/cloud/overseer/ZkWriteCommand.java | 10 +--
 .../solr/cloud/SplitShardWithNodeRoleTest.java     | 98 ----------------------
 3 files changed, 1 insertion(+), 119 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/cloud/overseer/ReplicaMutator.java b/solr/core/src/java/org/apache/solr/cloud/overseer/ReplicaMutator.java
index e6ea190534c..7674efa3cfa 100644
--- a/solr/core/src/java/org/apache/solr/cloud/overseer/ReplicaMutator.java
+++ b/solr/core/src/java/org/apache/solr/cloud/overseer/ReplicaMutator.java
@@ -447,8 +447,6 @@ public class ReplicaMutator {
             Utils.toJSONString(oldReplica.getProperties()),
             Utils.toJSONString(replica.getProperties()));
         return ZkWriteCommand.NO_OP;
-      } else {
-        log.info("state.json persisted for a PRS collection :{} for message {}", collectionName, Utils.toJSONString(message));
       }
     }
     return new ZkWriteCommand(collectionName, newCollection);
@@ -468,16 +466,6 @@ public class ReplicaMutator {
               newReplica.getProperties().get(ZkStateReader.FORCE_SET_STATE_PROP));
       return true;
     }
-    Slice slice = coll.getSlice(newReplica.getShard());
-    //the slice may be in recovery
-    if(slice.getState() == Slice.State.RECOVERY) {
-      log.info("{} state_is_recovery",slice.getName() );
-      return true;
-    }
-    if (Objects.equals(oldReplica.getProperties().get("state"), "recovering")) {
-      log.info("{} state_is_recovering",newReplica.name );
-      return true;
-    }
     return false;
   }
 
diff --git a/solr/core/src/java/org/apache/solr/cloud/overseer/ZkWriteCommand.java b/solr/core/src/java/org/apache/solr/cloud/overseer/ZkWriteCommand.java
index 6275b885325..f2d5466f760 100644
--- a/solr/core/src/java/org/apache/solr/cloud/overseer/ZkWriteCommand.java
+++ b/solr/core/src/java/org/apache/solr/cloud/overseer/ZkWriteCommand.java
@@ -50,14 +50,6 @@ public class ZkWriteCommand {
 
   @Override
   public String toString() {
-    return getClass().getSimpleName()
-        + ": "
-        + (this == NO_OP ? "no-op" : name + "=" + this.name)
-        + " pjs: "
-        + this.persistJsonState
-        + ", prs: "
-        + this.isPerReplicaStateCollection
-        + " , ops:"
-        + this.ops;
+    return getClass().getSimpleName() + ": " + (this == NO_OP ? "no-op" : name + "=" + collection);
   }
 }
diff --git a/solr/core/src/test/org/apache/solr/cloud/SplitShardWithNodeRoleTest.java b/solr/core/src/test/org/apache/solr/cloud/SplitShardWithNodeRoleTest.java
deleted file mode 100644
index 78bbbc8e015..00000000000
--- a/solr/core/src/test/org/apache/solr/cloud/SplitShardWithNodeRoleTest.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.solr.cloud;
-
-import java.lang.invoke.MethodHandles;
-import java.util.HashSet;
-import java.util.Set;
-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.junit.BeforeClass;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class SplitShardWithNodeRoleTest extends SolrCloudTestCase {
-  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-
-  @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);
-    }
-
-    Set<String> overseerNodes = new HashSet<>();
-    System.setProperty(NodeRoles.NODE_ROLES_PROP, "data:off,overseer:preferred");
-    try {
-      overseerNodes.add(cluster.startJettySolrRunner().getNodeName());
-      overseerNodes.add(cluster.startJettySolrRunner().getNodeName());
-    } finally {
-      System.clearProperty(NodeRoles.NODE_ROLES_PROP);
-    }
-    OverseerRolesTest.waitForNewOverseer(10, overseerNodes::contains, false);
-  }
-
-  @Test
-  public void testSolrClusterWithNodeRoleWithSingleReplica() throws Exception {
-    doSplit("coll_ONLY_NRT", 1, 1, 0);
-  }
-
-  @Test
-  public void testSolrClusterWithNodeRoleWithPull() throws Exception {
-    doSplit("coll_NRT_PULL", 1, 1, 1);
-  }
-
-  public void doSplit(String collName, int shard, int nrtReplica, int pullReplica)
-      throws Exception {
-    CloudSolrClient client = cluster.getSolrClient();
-    CollectionAdminRequest.createCollection(collName, "conf", shard, nrtReplica, 0, pullReplica)
-        .setPerReplicaState(true)
-        .process(cluster.getSolrClient());
-    cluster.waitForActiveCollection(collName, shard, nrtReplica + pullReplica);
-    UpdateRequest ur = new UpdateRequest();
-    for (int i = 0; i < 10; i++) {
-      SolrInputDocument doc2 = new SolrInputDocument();
-      doc2.addField("id", "" + i);
-      ur.add(doc2);
-    }
-
-    ur.commit(client, collName);
-
-    CollectionAdminRequest.SplitShard splitShard =
-        CollectionAdminRequest.splitShard(collName).setShardName("shard1");
-    splitShard.process(cluster.getSolrClient());
-    waitForState(
-        "Timed out waiting for sub shards to be active. Number of active shards="
-            + cluster
-                .getSolrClient()
-                .getClusterState()
-                .getCollection(collName)
-                .getActiveSlices()
-                .size(),
-        collName,
-        activeClusterShape(shard + 1, 3 * (nrtReplica + pullReplica)));
-  }
-}