muse-dev[bot] commented on a change in pull request #133: URL: https://github.com/apache/solr/pull/133#discussion_r635636714
########## File path: solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java ########## @@ -258,6 +260,37 @@ public void testAddDocs() throws Exception { assertUlogPresence(docCollection); } + private List<Replica> restartPullReplica(DocCollection docCollection, int numPullReplicas) throws Exception { + Slice s = docCollection.getSlices().iterator().next(); + List<Replica> pullReplicas = s.getReplicas(EnumSet.of(Replica.Type.PULL)); + // make sure a PULL replica recovers this first doc after a restart + JettySolrRunner leaderJetty = cluster.getReplicaJetty(s.getLeader()); + + // find a node with a PULL replica that's not hosting the leader + JettySolrRunner replicaJetty = null; + for (Replica r : pullReplicas) { + JettySolrRunner jetty = cluster.getReplicaJetty(r); + if (!jetty.getNodeName().equals(leaderJetty.getNodeName())) { + replicaJetty = jetty; + break; + } + } + + // stop / start the node with a pull replica + if (replicaJetty != null) { Review comment: *opt.semgrep.java.lang.correctness.eqeq.eqeq:* `replicaJetty == replicaJetty` or `replicaJetty != replicaJetty` is always true. (Unless the value compared is a float or double). To test if `replicaJetty` is not-a-number, use `Double.isNaN(replicaJetty)`. (at-me [in a reply](https://docs.muse.dev/docs/talk-to-muse/) with `help` or `ignore`) -- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org