You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2015/10/04 15:57:41 UTC

svn commit: r1706682 - in /lucene/dev/branches/branch_5x: ./ solr/ solr/CHANGES.txt solr/core/ solr/core/src/java/org/apache/solr/update/HdfsUpdateLog.java

Author: markrmiller
Date: Sun Oct  4 13:57:41 2015
New Revision: 1706682

URL: http://svn.apache.org/viewvc?rev=1706682&view=rev
Log:
SOLR-8094: HdfsUpdateLog should not replay buffered documents as a replacement to dropping them.

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/solr/   (props changed)
    lucene/dev/branches/branch_5x/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_5x/solr/core/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/HdfsUpdateLog.java

Modified: lucene/dev/branches/branch_5x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/CHANGES.txt?rev=1706682&r1=1706681&r2=1706682&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/solr/CHANGES.txt Sun Oct  4 13:57:41 2015
@@ -126,6 +126,9 @@ Bug Fixes
   
 * SOLR-8085: Fix a variety of issues that can result in replicas getting out of sync. (yonik, Mark Miller)
 
+* SOLR-8094: HdfsUpdateLog should not replay buffered documents as a replacement to dropping them.
+  (Mark Miller)
+
 Optimizations
 ----------------------
 

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/HdfsUpdateLog.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/HdfsUpdateLog.java?rev=1706682&r1=1706681&r2=1706682&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/HdfsUpdateLog.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/HdfsUpdateLog.java Sun Oct  4 13:57:41 2015
@@ -23,8 +23,6 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Locale;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
 import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.hadoop.conf.Configuration;
@@ -68,13 +66,26 @@ public class HdfsUpdateLog extends Updat
   // allows for it
   @Override
   public boolean dropBufferedUpdates() {
-    Future<RecoveryInfo> future = applyBufferedUpdates();
-    if (future != null) {
-      try {
-        future.get();
-      } catch (InterruptedException | ExecutionException e) {
-        throw new RuntimeException(e);
+    versionInfo.blockUpdates();
+    try {
+      if (state != State.BUFFERING) return false;
+      
+      if (log.isInfoEnabled()) {
+        log.info("Dropping buffered updates " + this);
       }
+      
+      // since we blocked updates, this synchronization shouldn't strictly be
+      // necessary.
+      synchronized (this) {
+        if (tlog != null) {
+          // tlog.rollback(recoveryInfo.positionOfStart);
+        }
+      }
+      
+      state = State.ACTIVE;
+      operationFlags &= ~FLAG_GAP;
+    } finally {
+      versionInfo.unblockUpdates();
     }
     return true;
   }