You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/06/22 13:52:24 UTC
[GitHub] [lucene-solr] mikemccand commented on a change in pull request #1576: Alternative approach to LUCENE-8962
mikemccand commented on a change in pull request #1576:
URL: https://github.com/apache/lucene-solr/pull/1576#discussion_r443573360
##########
File path: lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
##########
@@ -2144,39 +2145,43 @@ private synchronized boolean updatePendingMerges(MergePolicy mergePolicy, MergeT
assert maxNumSegments == UNBOUNDED_MAX_MERGE_SEGMENTS || maxNumSegments > 0;
assert trigger != null;
if (stopMerges) {
- return false;
+ return null;
}
// Do not start new merges if disaster struck
if (tragedy.get() != null) {
- return false;
+ return null;
}
- boolean newMergesFound = false;
final MergePolicy.MergeSpecification spec;
if (maxNumSegments != UNBOUNDED_MAX_MERGE_SEGMENTS) {
assert trigger == MergeTrigger.EXPLICIT || trigger == MergeTrigger.MERGE_FINISHED :
"Expected EXPLICT or MERGE_FINISHED as trigger even with maxNumSegments set but was: " + trigger.name();
spec = mergePolicy.findForcedMerges(segmentInfos, maxNumSegments, Collections.unmodifiableMap(segmentsToMerge), this);
- newMergesFound = spec != null;
- if (newMergesFound) {
+ if (spec != null) {
final int numMerges = spec.merges.size();
for(int i=0;i<numMerges;i++) {
final MergePolicy.OneMerge merge = spec.merges.get(i);
merge.maxNumSegments = maxNumSegments;
}
}
} else {
- spec = mergePolicy.findMerges(trigger, segmentInfos, this);
+ switch (trigger) {
+ case COMMIT:
Review comment:
Full flush happens for refresh and commit.
But we have only implemented "merge on commit" so far.
I would love to also add "merge on refresh", but until we do so, I think it's correct for `IndexWriter` to separate out the `COMMIT` case here like this.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org