LUCENE-9147: Avoid reusing file names with FileSwitchDirectory or NRTCachingDirectory and IOContext randomization.

This commit is contained in:
Adrien Grand 2020-02-05 18:54:49 +01:00
parent 63be99bf12
commit 1b882246d7
1 changed files with 2 additions and 2 deletions

View File

@ -79,12 +79,12 @@ public final class FieldsIndexWriter implements Closeable {
this.id = id;
this.blockShift = blockShift;
this.ioContext = ioContext;
this.docsOut = dir.createTempOutput(name, "doc_ids", ioContext);
this.docsOut = dir.createTempOutput(name, codecName + "-doc_ids", ioContext);
IndexOutput filePointersOut = null;
boolean success = false;
try {
CodecUtil.writeHeader(docsOut, codecName + "Docs", VERSION_CURRENT);
this.filePointersOut = filePointersOut = dir.createTempOutput(name, "file_pointers", ioContext);
this.filePointersOut = filePointersOut = dir.createTempOutput(name, codecName + "file_pointers", ioContext);
CodecUtil.writeHeader(filePointersOut, codecName + "FilePointers", VERSION_CURRENT);
success = true;
} finally {