You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by yo...@apache.org on 2011/12/03 02:48:58 UTC

svn commit: r1209822 - in /lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr: handler/SnapPuller.java update/FSUpdateLog.java

Author: yonik
Date: Sat Dec  3 01:48:58 2011
New Revision: 1209822

URL: http://svn.apache.org/viewvc?rev=1209822&view=rev
Log:
protect recovery against non-distrib update processor commits

Modified:
    lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/SnapPuller.java
    lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/FSUpdateLog.java

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/SnapPuller.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/SnapPuller.java?rev=1209822&r1=1209821&r2=1209822&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/SnapPuller.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/handler/SnapPuller.java Sat Dec  3 01:48:58 2011
@@ -474,18 +474,11 @@ public class SnapPuller {
   }
 
   private void doCommit(boolean isFullCopyNeeded) throws IOException {
-    SolrQueryRequest req = new LocalSolrQueryRequest(solrCore,
-        new ModifiableSolrParams());
-    try {
-      
-      // reboot the writer on the new index and get a new searcher
-      solrCore.getUpdateHandler().newIndexWriter();
-      solrCore.getSearcher(true, false, null);
-      
-      replicationHandler.refreshCommitpoint(isFullCopyNeeded);
-    } finally {
-      req.close();
-    }
+    // reboot the writer on the new index and get a new searcher
+    solrCore.getUpdateHandler().newIndexWriter();
+    solrCore.getSearcher(true, false, null);
+
+    replicationHandler.refreshCommitpoint(isFullCopyNeeded);
   }
 
 

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/FSUpdateLog.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/FSUpdateLog.java?rev=1209822&r1=1209821&r2=1209822&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/FSUpdateLog.java (original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/FSUpdateLog.java Sat Dec  3 01:48:58 2011
@@ -331,6 +331,14 @@ public class FSUpdateLog extends UpdateL
         log.debug("TLOG: preCommit");
       }
 
+      if (getState() != State.ACTIVE && (cmd.getFlags() & UpdateCommand.REPLAY) == 0) {
+        // if we aren't in the active state, and this isn't a replay
+        // from the recovery process, then we shouldn't mess with
+        // the current transaction log.  This normally shouldn't happen
+        // as DistributedUpdateProcessor will prevent this.  Commits
+        // that don't use the processor are possible though.
+        return;
+      }
 
       // since we're changing the log, we must change the map.
       newMap();
@@ -604,7 +612,7 @@ public class FSUpdateLog extends UpdateL
 
     tlog.incref();
     if (recoveryExecutor.isShutdown()) {
-      throw new RuntimeException("executore is not running...");
+      throw new RuntimeException("executor is not running...");
     }
     ExecutorCompletionService<RecoveryInfo> cs = new ExecutorCompletionService<RecoveryInfo>(recoveryExecutor);
     LogReplayer replayer = new LogReplayer(tlog, true);