mlbiscoc commented on code in PR #4310:
URL: https://github.com/apache/solr/pull/4310#discussion_r3117878182
##########
solr/core/src/test/org/apache/solr/update/SolrIndexFingerprintTest.java:
##########
@@ -38,13 +43,23 @@ public void testSequentialVsParallelFingerprint() throws
Exception {
SolrCore core = h.getCore();
int numDocs = RANDOM_MULTIPLIER == 1 ? 3 : 500;
- // Create a set of many segments (to catch race conditions, i.e.
SOLR-17863)
- IntStream.range(0, numDocs)
- .forEach(
- i -> {
- assertU(adoc("id", "" + i));
- assertU(commit());
- });
+ // Create a set of many segments (to catch race conditions, i.e.
SOLR-17863).
+ // Write directly to the IndexWriter and flush after each doc to create
one segment per doc,
+ // avoiding the overhead of opening a new searcher on every Solr commit.
+ RefCounted<IndexWriter> iwRef =
core.getSolrCoreState().getIndexWriter(core);
+ try {
+ IndexWriter writer = iwRef.get();
+ for (int i = 0; i < numDocs; i++) {
Review Comment:
```suggestion
IndexWriter writer = iwRef.get();
writer.getConfig().setMergePolicy(NoMergePolicy.INSTANCE);;
for (int i = 0; i < numDocs; i++) {
```
Should we add this `NoMergePolicy`? I know we used
`solrconfig-nomergepolicyfactory.xml` for config but does this bypass that? I
trust you that this probably still creates the segments without it.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]