accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject [1/4] git commit: ACCUMULO-3140 made user initiated majC wait for current minC to finish
Date Fri, 19 Sep 2014 22:23:15 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.6.1-SNAPSHOT dcb081cae -> e1c9a1f6c


ACCUMULO-3140 made user initiated majC wait for current minC to finish


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/ad1c8075
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/ad1c8075
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/ad1c8075

Branch: refs/heads/1.6.1-SNAPSHOT
Commit: ad1c807568a7271facad6a729e03378aae4b2841
Parents: 52d30c7
Author: Keith Turner <kturner@apache.org>
Authored: Thu Sep 18 15:24:30 2014 -0400
Committer: Keith Turner <kturner@apache.org>
Committed: Fri Sep 19 17:16:16 2014 -0400

----------------------------------------------------------------------
 .../accumulo/server/tabletserver/Tablet.java    | 24 ++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/ad1c8075/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java b/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
index bb13ff8..9bbae89 100644
--- a/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
+++ b/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
@@ -404,6 +404,14 @@ public class Tablet {
   private long lastFlushID = -1;
   private long lastCompactID = -1;
   
+  private static class CompactionWaitInfo {
+    long flushID = -1;
+    long compactionID = -1;
+  }
+
+  // stores info about user initiated major compaction that is waiting on a minor compaction
to finish
+  private CompactionWaitInfo compactionWaitInfo = new CompactionWaitInfo();
+
   private KeyExtent extent;
   
   private TabletResourceManager tabletResources;
@@ -3900,10 +3908,22 @@ public class Tablet {
     synchronized (this) {
       if (lastCompactID >= compactionId)
         return;
-      
+
+      if (minorCompactionInProgress) {
+        // want to wait for running minc to finish before starting majc, see ACCUMULO-3041
+        if (compactionWaitInfo.compactionID == compactionId) {
+          if (lastFlushID == compactionWaitInfo.flushID)
+            return;
+        } else {
+          compactionWaitInfo.compactionID = compactionId;
+          compactionWaitInfo.flushID = lastFlushID;
+          return;
+        }
+      }
+
       if (closing || closed || majorCompactionQueued.contains(MajorCompactionReason.USER)
|| majorCompactionInProgress)
         return;
-      
+
       if (datafileManager.getDatafileSizes().size() == 0) {
         // no files, so jsut update the metadata table
         majorCompactionInProgress = true;


Mime
View raw message