add comment

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@946330 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2010-05-19 18:37:21 +00:00
parent fe5f1aabcb
commit 9f973b6988
1 changed files with 9 additions and 0 deletions

View File

@ -4401,6 +4401,15 @@ public class IndexWriter implements Closeable {
if (mergeDocStores && !merge.mergeDocStores) { if (mergeDocStores && !merge.mergeDocStores) {
merge.mergeDocStores = true; merge.mergeDocStores = true;
synchronized(this) { synchronized(this) {
// If 1) we must now merge doc stores, and 2) at
// least one of the segments we are merging uses
// the doc store we are now writing to, we must at
// this point force this doc store closed (by
// calling flush). If we didn't do this then the
// readers will attempt to open an IndexInput
// on files that have still-open IndexOutputs
// against them:
if (dss.contains(docWriter.getDocStoreSegment())) { if (dss.contains(docWriter.getDocStoreSegment())) {
if (infoStream != null) if (infoStream != null)
message("now flush at mergeMiddle"); message("now flush at mergeMiddle");