lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r409690 - in /lucene/java/trunk: CHANGES.txt src/java/org/apache/lucene/index/IndexWriter.java
Date Fri, 26 May 2006 16:14:12 GMT
Author: cutting
Date: Fri May 26 09:14:12 2006
New Revision: 409690

URL: http://svn.apache.org/viewvc?rev=409690&view=rev
Log:
LUCENE-485.  Don't hold commit lock while removing obsolete index files.  Contributed by Luc
Vanlerberghe.

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

Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?rev=409690&r1=409689&r2=409690&view=diff
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Fri May 26 09:14:12 2006
@@ -81,6 +81,10 @@
 15. LUCENE-546: Removed 2GB file size limitations for RAMDirectory.
     (Peter Royal, Michael Chan, Yonik Seeley)
 
+16. LUCENE-485: Don't hold commit lock while removing obsolete index
+    files.  (Luc Vanlerberghe via cutting)
+
+
 1.9.1
 
 Bug fixes

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java?rev=409690&r1=409689&r2=409690&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java Fri May 26 09:14:12
2006
@@ -614,12 +614,13 @@
       new Lock.With(directory.makeLock(COMMIT_LOCK_NAME), commitLockTimeout) {
 	  public Object doBody() throws IOException {
 	    segmentInfos.write(directory);	  // commit changes
-	    deleteSegments(segmentsToDelete);  // delete now-unused segments
 	    return null;
 	  }
 	}.run();
     }
     
+    deleteSegments(segmentsToDelete);  // delete now-unused segments
+
     if (useCompoundFile) {
       final Vector filesToDelete = merger.createCompoundFile(mergedName + ".tmp");
       synchronized (directory) { // in- & inter-process sync
@@ -627,12 +628,13 @@
           public Object doBody() throws IOException {
             // make compound file visible for SegmentReaders
             directory.renameFile(mergedName + ".tmp", mergedName + ".cfs");
-            // delete now unused files of segment 
-            deleteFiles(filesToDelete);   
             return null;
           }
         }.run();
       }
+
+      // delete now unused files of segment 
+      deleteFiles(filesToDelete);   
     }
   }
 
@@ -722,12 +724,13 @@
       new Lock.With(directory.makeLock(COMMIT_LOCK_NAME), commitLockTimeout) {
           public Object doBody() throws IOException {
             segmentInfos.write(directory);     // commit before deleting
-            deleteSegments(segmentsToDelete);  // delete now-unused segments
             return null;
           }
         }.run();
     }
     
+    deleteSegments(segmentsToDelete);  // delete now-unused segments
+
     if (useCompoundFile) {
       final Vector filesToDelete = merger.createCompoundFile(mergedName + ".tmp");
       synchronized (directory) { // in- & inter-process sync
@@ -735,12 +738,13 @@
           public Object doBody() throws IOException {
             // make compound file visible for SegmentReaders
             directory.renameFile(mergedName + ".tmp", mergedName + ".cfs");
-            // delete now unused files of segment 
-            deleteFiles(filesToDelete);   
             return null;
           }
         }.run();
       }
+
+      // delete now unused files of segment 
+      deleteFiles(filesToDelete);   
     }
   }
 



Mime
View raw message