mikemccand commented on code in PR #633:
URL: https://github.com/apache/lucene/pull/633#discussion_r862905078


##########
lucene/test-framework/src/java/org/apache/lucene/tests/index/MockRandomMergePolicy.java:
##########
@@ -86,6 +86,20 @@ public MergeSpecification findMerges(
     return mergeSpec;
   }
 
+  @Override
+  public MergeSpecification findMerges(CodecReader... readers) throws 
IOException {
+    if (random.nextBoolean() == true) {
+      return super.findMerges(readers);
+    } else {
+      // create a oneMerge for each reader to let them get concurrently 
processed by addIndexes()

Review Comment:
   Woops, sorry @vigyasharma: it was my suggestion to try to use the concurrent 
`addIndexes` sometimes, randomly, via `MockMergePolicy` or 
`AlcoholicMergePolicy` in the few tests that also test 
`addIndexes(CodecReader[])`!!!
   
   Apparently that was controversial -- I love it :)  So let's just revert that 
and rely on the awesome dedicated unit tests @vigyasharma already added?
   
   Remember that this feature is not enabled by default -- users who upgrade 
will still see the slow single-threaded `addIndexes`, unless they customize 
their `MergePolicy`.  If we make this PR/change we can iterate over time as 
users try to adopt it and perhaps eventually make it the default.  Concurrent 
background merging was also controversial when it was first proposed, yet 
concurrency is vital to take advantage of modern hardware.  Lucene shows its 
age by having so many single threaded operations.
   
   Also, it's unfortunate that improving Lucene's concurrency risks 
non-reproducible tests.  I wish the JVM would enable a seed-reproducible mode 
where it consistently scheduled threads down to the byte-code or ASM 
instruction (I know this is hard, but, still).  This problem will only get 
worse for us as we try to improve Lucene's default ability to leverage all the 
cores in modern CPUs.



-- 
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-unsubscr...@lucene.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to