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/10/10 20:21:57 UTC

[GitHub] [solr-sandbox] anshumg commented on a diff in pull request #48: Check batch-size against "max" before mirroring

anshumg commented on code in PR #48:
URL: https://github.com/apache/solr-sandbox/pull/48#discussion_r991615388


##########
crossdc-producer/src/test/java/org/apache/solr/crossdc/SolrAndKafkaIntegrationTest.java:
##########
@@ -245,6 +246,25 @@ public void testMirroringUpdateProcessor() throws Exception {
     assertClusterEventuallyHasDocs(cluster1Client, ALT_COLLECTION, "*:*", 2);
     assertCluster2EventuallyHasDocs(ALT_COLLECTION, normalDocQuery, 1);
     assertCluster2EventuallyHasDocs(ALT_COLLECTION, "*:*", 1);
+
+    // Index batch of docs that will exceed the max mirroring batch size cumulatively (but not individually)
+    // Batch consists of 100 docs each roughly 1/100th of the max-batch-size
+    docsToIndex.clear();
+    for (int i = 0; i < 100; i++) {
+      final SolrInputDocument doc = new SolrInputDocument();
+      doc.addField("id", "cumulativelyTooLarge-" + System.currentTimeMillis() + "-" + i);
+      doc.addField("cumulativelyTooLarge_b", "true");
+      doc.addField("text", new String(new byte[MAX_MIRROR_BATCH_SIZE_BYTES / 100]));
+      docsToIndex.add(doc);
+    }
+    cluster1Client.add(ALT_COLLECTION, docsToIndex);
+    cluster1Client.commit(ALT_COLLECTION);
+
+    final String cumulativelyTooLargeQuery = "cumulativelyTooLarge_b:true";
+    // Primary (but not secondary) should have 5 additional docs
+    assertClusterEventuallyHasDocs(cluster1Client, ALT_COLLECTION, cumulativelyTooLargeQuery, 100);
+    assertCluster2EventuallyHasDocs(ALT_COLLECTION, cumulativelyTooLargeQuery, 0);
+    assertCluster2EventuallyHasDocs(ALT_COLLECTION, cumulativelyTooLargeQuery, 0);

Review Comment:
   need to delete this line



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