incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject svn commit: r1292865 - in /incubator/accumulo/trunk: ./ src/core/ src/server/ src/server/src/main/java/org/apache/accumulo/server/master/Master.java src/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java
Date Thu, 23 Feb 2012 17:43:43 GMT
Author: kturner
Date: Thu Feb 23 17:43:43 2012
New Revision: 1292865

URL: http://svn.apache.org/viewvc?rev=1292865&view=rev
Log:
ACCUMULO-424 fixed bugs related to how merge handles walogs (merged from 1.4)

Modified:
    incubator/accumulo/trunk/   (props changed)
    incubator/accumulo/trunk/src/core/   (props changed)
    incubator/accumulo/trunk/src/server/   (props changed)
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java

Propchange: incubator/accumulo/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Feb 23 17:43:43 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611,1228195,1230180,1230736,1231043,1236873,1245632
 /incubator/accumulo/branches/1.3.5rc:1209938
-/incubator/accumulo/branches/1.4:1201902-1292511
+/incubator/accumulo/branches/1.4:1201902-1292862

Propchange: incubator/accumulo/trunk/src/core/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Feb 23 17:43:43 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3.5rc/src/core:1209938
 /incubator/accumulo/branches/1.3/src/core:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215
-/incubator/accumulo/branches/1.4/src/core:1201902-1292511
+/incubator/accumulo/branches/1.4/src/core:1201902-1292862

Propchange: incubator/accumulo/trunk/src/server/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Feb 23 17:43:43 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3.5rc/src/server:1209938
 /incubator/accumulo/branches/1.3/src/server:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611
-/incubator/accumulo/branches/1.4/src/server:1201902-1292511
+/incubator/accumulo/branches/1.4/src/server:1201902-1292862

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/Master.java?rev=1292865&r1=1292864&r2=1292865&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
(original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
Thu Feb 23 17:43:43 2012
@@ -1231,11 +1231,18 @@ public class Master implements LiveTServ
             case SPLITTING:
               return TabletGoalState.HOSTED;
             case WAITING_FOR_CHOPPED:
+              if (tls.getState(onlineTabletServers()).equals(TabletState.HOSTED)) {
+                if (tls.chopped)
+                  return TabletGoalState.UNASSIGNED;
+              } else {
+                if (tls.chopped && tls.walogs.isEmpty())
+                  return TabletGoalState.UNASSIGNED;
+              }
+              
+              return TabletGoalState.HOSTED;
             case WAITING_FOR_OFFLINE:
             case MERGING:
-              if (tls.walogs.isEmpty() && tls.chopped)
-                return TabletGoalState.UNASSIGNED;
-              return TabletGoalState.HOSTED;
+              return TabletGoalState.UNASSIGNED;
           }
         }
       }

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java?rev=1292865&r1=1292864&r2=1292865&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java
(original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java
Thu Feb 23 17:43:43 2012
@@ -78,8 +78,13 @@ public class MergeStats {
       return;
     if (info.needsToBeChopped(ke)) {
       this.needsToBeChopped++;
-      if (chopped && !hasWALs)
-        this.chopped++;
+      if (chopped) {
+        if (state.equals(TabletState.HOSTED)) {
+          this.chopped++;
+        } else if (!hasWALs) {
+          this.chopped++;
+        }
+      }
     }
     this.total++;
     if (state.equals(TabletState.HOSTED))
@@ -92,40 +97,40 @@ public class MergeStats {
     MergeState state = info.getState();
     if (state == MergeState.NONE)
       return state;
-    log.info("Computing next merge state for " + info.getRange() + " which is presently "
+ state);
+    log.info("Computing next merge state for " + info.getRange() + " which is presently "
+ state + " isDelete : " + info.isDelete());
     if (state == MergeState.STARTED) {
       state = MergeState.SPLITTING;
     }
     if (total == 0) {
-      log.info("failed to see any tablets for this range, ignoring");
+      log.info("failed to see any tablets for this range, ignoring " + info.getRange());
       return state;
     }
     if (state == MergeState.SPLITTING) {
       log.info(hosted + " are hosted, total " + total);
       if (!info.isDelete() && total == 1) {
-        log.info("Merge range is already contained in a single tablet");
+        log.info("Merge range is already contained in a single tablet " + info.getRange());
         state = MergeState.COMPLETE;
       } else if (hosted == total) {
         if (info.isDelete()) {
           if (!lowerSplit)
-            log.info("Waiting for " + info + " lower split to occur");
+            log.info("Waiting for " + info + " lower split to occur " + info.getRange());
           else if (!upperSplit)
-            log.info("Waiting for " + info + " upper split to occur");
+            log.info("Waiting for " + info + " upper split to occur " + info.getRange());
           else
             state = MergeState.WAITING_FOR_CHOPPED;
         } else {
           state = MergeState.WAITING_FOR_CHOPPED;
         }
       } else {
-        log.info("Waiting for " + hosted + " hosted tablets to be " + total);
+        log.info("Waiting for " + hosted + " hosted tablets to be " + total + " " + info.getRange());
       }
     }
     if (state == MergeState.WAITING_FOR_CHOPPED) {
-      log.info(chopped + " tablets are chopped");
+      log.info(chopped + " tablets are chopped " + info.getRange());
       if (chopped == needsToBeChopped) {
         state = MergeState.WAITING_FOR_OFFLINE;
       } else {
-        log.info("Waiting for " + chopped + " chopped tablets to be " + needsToBeChopped);
+        log.info("Waiting for " + chopped + " chopped tablets to be " + needsToBeChopped
+ " " + info.getRange());
       }
     }
     if (state == MergeState.WAITING_FOR_OFFLINE) {
@@ -134,11 +139,11 @@ public class MergeStats {
         // Perhaps a split occurred after we chopped, but before we went offline: start over
         state = MergeState.WAITING_FOR_CHOPPED;
       } else {
-        log.info(chopped + " tablets are chopped, " + unassigned + " are offline");
+        log.info(chopped + " tablets are chopped, " + unassigned + " are offline " + info.getRange());
         if (unassigned == total && chopped == needsToBeChopped) {
           state = MergeState.MERGING;
         } else {
-          log.info("Waiting for " + unassigned + " unassigned tablets to be " + total);
+          log.info("Waiting for " + unassigned + " unassigned tablets to be " + total + "
" + info.getRange());
         }
       }
     }
@@ -153,7 +158,7 @@ public class MergeStats {
         log.error("Unexpected state: unassigned tablets should be " + total + " was " + unassigned
+ " merge " + info.getRange());
         state = MergeState.WAITING_FOR_CHOPPED;
       }
-      log.info(unassigned + " tablets are unassigned");
+      log.info(unassigned + " tablets are unassigned " + info.getRange());
     }
     return state;
   }
@@ -178,10 +183,11 @@ public class MergeStats {
       if (!tls.extent.getTableId().equals(tableId)) {
         break;
       }
-      if (!tls.walogs.isEmpty()) {
+
+      if (!tls.walogs.isEmpty() && verify.getMergeInfo().overlaps(tls.extent)) {
         return false;
       }
-      
+
       if (prevExtent == null) {
         // this is the first tablet observed, it must be offline and its prev row must be
less than the start of the merge range
         if (tls.extent.getPrevEndRow() != null && tls.extent.getPrevEndRow().compareTo(start)
> 0) {



Mime
View raw message