mirror of https://github.com/apache/lucene.git
MockRandomMP's force merge must also merge away pending but not written deletions
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1667140 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e18c94f1db
commit
39d6e2e38e
|
@ -388,6 +388,7 @@ public abstract class BaseNormsFormatTestCase extends BaseIndexFileFormatTestCas
|
|||
}
|
||||
w.forceMerge(1);
|
||||
IndexReader r = w.getReader();
|
||||
assertFalse(r.hasDeletions());
|
||||
|
||||
// Confusingly, norms should exist, and should all be 0, even though we deleted all docs that had the field "content". They should not
|
||||
// be undead:
|
||||
|
|
|
@ -97,7 +97,7 @@ public class MockRandomMergePolicy extends MergePolicy {
|
|||
|
||||
//System.out.println("MRMP: findMerges sis=" + segmentInfos + " eligible=" + eligibleSegments);
|
||||
MergeSpecification mergeSpec = null;
|
||||
if (eligibleSegments.size() > 1 || (eligibleSegments.size() == 1 && eligibleSegments.get(0).hasDeletions())) {
|
||||
if (eligibleSegments.size() > 1 || (eligibleSegments.size() == 1 && isMerged(segmentInfos, eligibleSegments.get(0), writer) == false)) {
|
||||
mergeSpec = new MergeSpecification();
|
||||
// Already shuffled having come out of a set but
|
||||
// shuffle again for good measure:
|
||||
|
|
Loading…
Reference in New Issue