mikemccand opened a new issue, #14993:
URL: https://github.com/apache/lucene/issues/14993

   ### Description
   
   I was debugging an issue with `addIndexes`, turned on `IndexWriter`'s 
`InfoStream` logging, and `ConcurrentMergeScheduler` periodically logs juicy 
details like this:
   
   ```
   MS 0 [2025-07-24T19:54:48.516458703Z; pool-4-thread-2]: updateMergeThreads 
ioThrottle=false targetMBPerSec=20.0 MB/sec
   merge thread Lucene Merge Thread #19 estSize=1137.2 MB (written=287.1 MB) 
runTime=15.6s (stopped=0.0s, paused=0.0s) rate=unlimited
     leave running at Infinity MB/sec
   merge thread Lucene Merge Thread #20 estSize=0.0 MB (written=0.0 MB) 
runTime=0.0s (stopped=0.0s, paused=0.0s) rate=unlimited
     leave running at Infinity MB/sec
   merge thread Lucene Merge Thread #21 estSize=0.0 MB (written=0.0 MB) 
runTime=0.0s (stopped=0.0s, paused=0.0s) rate=unlimited
     leave running at Infinity MB/sec
   merge thread Lucene Merge Thread #22 estSize=0.0 MB (written=0.0 MB) 
runTime=0.0s (stopped=0.0s, paused=0.0s) rate=unlimited
     leave running at Infinity MB/sec
   ```
   
   The top merge (`Lucene Merge Thread #19`) was a natural merge and it 
correctly sets the `estSize` (`OneMerge.estimatedMergeBytes`), 
[here](https://github.com/apache/lucene/blob/branch_10_2/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java#L4896-L4906).
   
   But the other merges all (incorrectly) show `estSize=0` because their merges 
bypass `IndexWriter.registerMerge` and instead [register here] 
(https://github.com/apache/lucene/blob/branch_10_2/lucene/core/src/java/org/apache/lucene/index/IndexWriter.java#L3295-L3299)
 (in `AddIndexesMergeSource`).
   
   This estimated size is useful for debugging ... e.g. [segment tracing 
tools](https://githubsearch.mikemccandless.com/segments_15.html) use it.  Also, 
`ConcurrentMergeScheduler` uses this when throttles merges.
   
   I think it should be a simple fix -- maybe factor out that code that 
computes the `estimatedMergeSize` for natural merges today, so it can be shared 
for merges triggered by `addIndexes` too?
   
   ### Version and environment details
   
   _No response_


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