You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/03/18 16:27:01 UTC

[GitHub] [solr] madrob commented on a change in pull request #744: SOLR-16097 Batch add docs when starting tests

madrob commented on a change in pull request #744:
URL: https://github.com/apache/solr/pull/744#discussion_r830162764



##########
File path: solr/core/src/test/org/apache/solr/update/PeerSyncTest.java
##########
@@ -213,26 +214,23 @@ public void test() throws Exception {
 
     // now lets check fingerprinting causes appropriate fails
     v = 4000;
-    add(client0, seenLeader, sdoc("id", Integer.toString((int) v), "_version_", v));
+    add(client0, seenLeader, sdoc("id", Integer.toString(v), "_version_", v));
     docsAdded.add(4000);
     int toAdd = numVersions + 10;
-    for (int i = 0; i < toAdd; i++) {
-      add(
-          client0,
-          seenLeader,
-          sdoc("id", Integer.toString((int) v + i + 1), "_version_", v + i + 1));
-      add(
-          client1,
-          seenLeader,
-          sdoc("id", Integer.toString((int) v + i + 1), "_version_", v + i + 1));
-      docsAdded.add((int) v + i + 1);
+
+    List<SolrInputDocument> additionalDocs = new ArrayList<>(toAdd);
+    for (int i = v + 1; i < v + toAdd + 1; i++) {
+      additionalDocs.add(sdoc("id", Integer.toString(i), "_version_", i));
+      docsAdded.add(i);
     }
+    add(client0, seenLeader, additionalDocs);
+    add(client1, seenLeader, additionalDocs);

Review comment:
       Each replica is still indexing independently, so as long as the relative order is the same it works out. i.e. `c0_1`, `c0_2`, `c1_1`, `c1_2` the specific interleaving won't have any effect.




-- 
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-unsubscribe@solr.apache.org

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



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