soren-xzk commented on code in PR #13017:
URL: https://github.com/apache/lucene/pull/13017#discussion_r1457089689


##########
lucene/core/src/java/org/apache/lucene/index/IndexWriter.java:
##########
@@ -5136,7 +5141,13 @@ private int mergeMiddle(MergePolicy.OneMerge merge, 
MergePolicy mergePolicy) thr
           sci -> {
             final ReadersAndUpdates rld = getPooledInstance(sci, true);
             rld.setIsMerging();
-            return rld.getReaderForMerge(context);
+            synchronized (this) {
+              return rld.getReaderForMerge(
+                  context,
+                  mr -> {
+                    deleter.incRef(mr.reader.getSegmentInfo().files());

Review Comment:
   There is an assert judgment in incRef/decRef, which must have the 
IndexWriter's lock. There is no lock in this place, may there be a problem?



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