mirror of https://github.com/apache/lucene.git
LUCENE-10648: Fix failures in TestAssertingPointsFormat.testWithExceptions (#1012)
* Fix failures in TestAssertingPointsFormat.testWithExceptions * remove redundant finally block * tidy * remove TODO as it is done now
This commit is contained in:
parent
56462b5f96
commit
ca7917472b
|
@ -3425,16 +3425,13 @@ public class IndexWriter
|
|||
if (useCompoundFile) {
|
||||
Collection<String> filesToDelete = merge.getMergeInfo().files();
|
||||
TrackingDirectoryWrapper trackingCFSDir = new TrackingDirectoryWrapper(mergeDirectory);
|
||||
// TODO: unlike merge, on exception we arent sniping any trash cfs files here?
|
||||
// createCompoundFile tries to cleanup, but it might not always be able to...
|
||||
try {
|
||||
createCompoundFile(
|
||||
infoStream, trackingCFSDir, merge.getMergeInfo().info, context, this::deleteNewFiles);
|
||||
} finally {
|
||||
// delete new non cfs files directly: they were never
|
||||
// registered with IFD
|
||||
|
||||
// creating cfs resets the files tracked in SegmentInfo. if it succeeds, we
|
||||
// delete the non cfs files directly as they are not tracked anymore.
|
||||
deleteNewFiles(filesToDelete);
|
||||
}
|
||||
merge.getMergeInfo().info.setUseCompoundFile(true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue