You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2010/05/19 20:37:22 UTC

svn commit: r946330 - /lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/IndexWriter.java

Author: mikemccand
Date: Wed May 19 18:37:21 2010
New Revision: 946330

URL: http://svn.apache.org/viewvc?rev=946330&view=rev
Log:
add comment

Modified:
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/IndexWriter.java

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/IndexWriter.java?rev=946330&r1=946329&r2=946330&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/IndexWriter.java Wed May 19 18:37:21 2010
@@ -4401,6 +4401,15 @@ public class IndexWriter implements Clos
       if (mergeDocStores && !merge.mergeDocStores) {
         merge.mergeDocStores = true;
         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 (infoStream != null)
               message("now flush at mergeMiddle");