[ 
https://issues.apache.org/jira/browse/LUCENE-8688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16780682#comment-16780682
 ] 

Adrien Grand commented on LUCENE-8688:
--------------------------------------

Thanks [~original-brownbear] for looking! I had a quick look and the handling 
of {{forceMergeRunning}} looks a bit suspicious. When true it seems that we 
never run forced merges unless the max segment count is 1 and all segments 
would fit into a single segment, while it seems like we used to only use it to 
prevent the final merge from running? FYI regarding testing, there are some 
utility methods to simulate merges (that not many tests are using since they 
are pretty recent) that help test more complex scenarii such as the case that 
there is already an ongoing merge.

> Forced merges merge more than necessary
> ---------------------------------------
>
>                 Key: LUCENE-8688
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8688
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Adrien Grand
>            Priority: Minor
>         Attachments: LUCENE-8688.patch
>
>
> A user reported some surprise after the upgrade to Lucene 7.5 due to changes 
> to how forced merges are selected when maxSegmentCount is greater than 1.
> Before 7.5 forceMerge used to pick up the least amount of merging that would 
> result in an index that has maxSegmentCount segments at most. Now that we 
> share the same logic as regular merges, we are almost sure to pick a 
> maxMergeAtOnceExplicit-segments merge (30 segments) given that merges that 
> have more segments usually score better. This is due to the fact that natural 
> merges assume that merges that run now save work for later, so the more 
> segments get merged, the better. This assumption doesn't hold for forced 
> merges that should run on read-only indices, so there won't be any future 
> merging.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to