mirror of https://github.com/apache/lucene.git
LUCENE-2610: addIndexes(Directory...) should not trigger merge on flush()
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@988084 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6a4bfc796f
commit
d526694314
|
@ -2870,7 +2870,7 @@ public class IndexWriter implements Closeable {
|
|||
try {
|
||||
if (infoStream != null)
|
||||
message("flush at addIndexes(Directory...)");
|
||||
flush(true, false, true);
|
||||
flush(false, false, true);
|
||||
|
||||
int docCount = 0;
|
||||
List<SegmentInfo> infos = new ArrayList<SegmentInfo>();
|
||||
|
|
|
@ -327,6 +327,7 @@ public class TestSnapshotDeletionPolicy extends LuceneTestCaseJ4 {
|
|||
writer.commit();
|
||||
writer.deleteUnusedFiles();
|
||||
assertSnapshotExists(dir, sdp, numSnapshots - 1);
|
||||
writer.close();
|
||||
|
||||
// but 'snapshot1' files will still exist (need to release snapshot before they can be deleted).
|
||||
String segFileName = sdp.getSnapshot("snapshot1").getSegmentsFileName();
|
||||
|
@ -358,6 +359,7 @@ public class TestSnapshotDeletionPolicy extends LuceneTestCaseJ4 {
|
|||
}
|
||||
assertNull(sdp.getSnapshots().get(snapId));
|
||||
writer.deleteUnusedFiles();
|
||||
writer.close();
|
||||
assertFalse("segments file should not be found in dirctory: " + segFileName, dir.fileExists(segFileName));
|
||||
dir.close();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue