lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r1234526 - in /lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr: handler/component/RealTimeGetComponent.java update/PeerSync.java update/TransactionLog.java update/UpdateLog.java
Date Sun, 22 Jan 2012 15:42:37 GMT
Author: yonik
Date: Sun Jan 22 15:42:36 2012
New Revision: 1234526

URL: http://svn.apache.org/viewvc?rev=1234526&view=rev
Log:
peersync wasn't closing the recent versions

Modified:
    lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
    lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/PeerSync.java
    lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/TransactionLog.java
    lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/UpdateLog.java

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java?rev=1234526&r1=1234525&r2=1234526&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
(original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
Sun Jan 22 15:42:36 2012
@@ -289,10 +289,11 @@ public class RealTimeGetComponent extend
     if (ulog == null) return;
 
     UpdateLog.RecentUpdates recentUpdates = ulog.getRecentUpdates();
-    
-    rb.rsp.add("versions", recentUpdates.getVersions(nVersions));
-    
-    recentUpdates.close();  // cache this somehow?
+    try {
+      rb.rsp.add("versions", recentUpdates.getVersions(nVersions));
+    } finally {
+      recentUpdates.close();  // cache this somehow?
+    }
   }
 
   

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/PeerSync.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/PeerSync.java?rev=1234526&r1=1234525&r2=1234526&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/PeerSync.java
(original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/PeerSync.java
Sun Jan 22 15:42:36 2012
@@ -138,7 +138,13 @@ public class PeerSync  {
     }
 
     recentUpdates = ulog.getRecentUpdates();
-    ourUpdates = recentUpdates.getVersions(nUpdates);
+    try {
+      ourUpdates = recentUpdates.getVersions(nUpdates);
+    } finally {
+      recentUpdates.close();
+    }
+    
+    
     Collections.sort(ourUpdates, absComparator);
 
     if (ourUpdates.size() > 0) {

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/TransactionLog.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/TransactionLog.java?rev=1234526&r1=1234525&r2=1234526&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/TransactionLog.java
(original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/TransactionLog.java
Sun Jan 22 15:42:36 2012
@@ -507,7 +507,7 @@ public class TransactionLog {
   }
 
   public String toString() {
-    return tlogFile.toString();
+    return "tlog{file=" + tlogFile.toString() + " refcount=" + refcount.get() + "}";
   }
 
   /** Returns a reader that can be used while a log is still in use.

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/UpdateLog.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/UpdateLog.java?rev=1234526&r1=1234525&r2=1234526&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/UpdateLog.java
(original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/UpdateLog.java
Sun Jan 22 15:42:36 2012
@@ -199,9 +199,7 @@ public class UpdateLog implements Plugin
       break;
     }
 
-    // shouldn't need to incref... we are taking ownership, but becoming
-    // an additional user.
-    // oldLog.incref();
+    // don't incref... we are taking ownership from the caller.
     logs.addFirst(oldLog);
   }
 
@@ -523,9 +521,7 @@ public class UpdateLog implements Plugin
     }
 
     try {
-      if (currLog != null) {
-        currLog.finish(syncLevel);
-      }
+      currLog.finish(syncLevel);
     } finally {
       currLog.decref();
     }



Mime
View raw message