jpountz commented on code in PR #935:
URL: https://github.com/apache/lucene/pull/935#discussion_r892164198


##########
lucene/core/src/java/org/apache/lucene/index/LogMergePolicy.java:
##########
@@ -568,23 +568,41 @@ public MergeSpecification findMerges(
       // Finally, record all merges that are viable at this level:

Review Comment:
   > how could it guarantee that the level decided in range of [start,end) 
won't contain segments that have lower level than levelBottom?
   
   LogMergePolicy doesn't try to provide this guarantee. It's actually 
important it doesn't try to provide this guarantee, otherwise it could end up 
with lots of unmerged segments. For instance imagine that you have 9 segments 
(S1..S9) on level 10 then one segment (S10) on level 9, one more segment on 
level 10 (S11) and then potentially other segments.
   If LogMergePolicy refused to merge segments that are on a lower level then 
it could never merge together segments S1..S10. This is because segment S10 can 
only be merged with segments that are on a higher level because both the 
previous and the next segment are on a higher level, and LogMergePolicy only 
merges adjacent segments.
   
   This is a downside of LogMergePolicy compared to TieredMergePolicy: because 
it only performs merges of adjacent segments, it sometimes has to return merges 
where not all segments are on the same level.



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