lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1236357 - /lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/IndexWriter.java
Date Thu, 26 Jan 2012 19:30:17 GMT
Author: mikemccand
Date: Thu Jan 26 19:30:17 2012
New Revision: 1236357

URL: http://svn.apache.org/viewvc?rev=1236357&view=rev
Log:
close merge readers before checkpoint, so IFD can delete the files

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=1236357&r1=1236356&r2=1236357&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 Thu Jan 26 19:30:17
2012
@@ -3182,7 +3182,12 @@ public class IndexWriter implements Clos
         readerPool.drop(merge.info);
       }
     }
-    
+
+    // Must close before checkpoint, otherwise IFD won't be
+    // able to delete the held-open files from the merge
+    // readers:
+    closeMergeReaders(merge, false);
+
     // Must note the change to segmentInfos so any commits
     // in-flight don't lose it:
     checkpoint();
@@ -3191,8 +3196,6 @@ public class IndexWriter implements Clos
       infoStream.message("IW", "after commit: " + segString());
     }
 
-    closeMergeReaders(merge, false);
-
     if (merge.maxNumSegments != -1 && !dropSegment) {
       // cascade the forceMerge:
       if (!segmentsToMerge.containsKey(merge.info)) {
@@ -3784,7 +3787,6 @@ public class IndexWriter implements Clos
 
   /** @lucene.internal */
   public synchronized String segString(SegmentInfo info) throws IOException {
-    StringBuilder buffer = new StringBuilder();
     return info.toString(info.dir, numDeletedDocs(info) - info.getDelCount());
   }
 



Mime
View raw message