LUCENE-6205: don't let doc values updates write in one thread at the same time as a merge kicking off in another

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1655426 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2015-01-28 18:20:55 +00:00
parent 06287f52ad
commit 9d5d43ff86
2 changed files with 12 additions and 1 deletions

View File

@ -470,6 +470,10 @@ Bug Fixes
* LUCENE-6173: NumericTermAttribute and spatial/CellTokenStream do not clone
their BytesRef(Builder)s. Also equals/hashCode was missing. (Uwe Schindler)
* LUCENE-6205: Fixed intermittent concurrency issue that could cause
FileNotFoundException when writing doc values updates at the same
time that a merge kicks off. (Mike McCandless)
Documentation

View File

@ -3927,7 +3927,14 @@ public class IndexWriter implements Closeable, TwoPhaseCommit, Accountable {
// fix the reader's live docs and del count
assert delCount > reader.numDeletedDocs(); // beware of zombies
SegmentReader newReader = new SegmentReader(info, reader, liveDocs, info.info.getDocCount() - delCount);
SegmentReader newReader;
synchronized (this) {
// We must also sync on IW here, because another thread could be writing
// new DV updates / remove old gen field infos files causing FNFE:
newReader = new SegmentReader(info, reader, liveDocs, info.info.getDocCount() - delCount);
}
boolean released = false;
try {
rld.release(reader);