incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1238615 - in /incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master: Master.java state/MergeStats.java
Date Tue, 31 Jan 2012 14:33:02 GMT
Author: ecn
Date: Tue Jan 31 14:33:01 2012
New Revision: 1238615

URL: http://svn.apache.org/viewvc?rev=1238615&view=rev
Log:
ACCUMULO-356: if the verify fails, the merge would never execute; improved logging for merge
state transistions.

Modified:
    incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
    incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java

Modified: incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java?rev=1238615&r1=1238614&r2=1238615&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
(original)
+++ incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
Tue Jan 31 14:33:01 2012
@@ -1490,22 +1490,23 @@ public class Master implements LiveTServ
       for (MergeStats stats : mergeStatsCache.values()) {
         try {
           MergeState update = stats.nextMergeState();
-          if (update != stats.getMergeInfo().getState()) {
-            if (update == MergeState.MERGING) {
-              if (stats.verifyMergeConsistency(getConnector(), Master.this)) {
-                try {
-                  if (stats.getMergeInfo().isDelete())
-                    deleteTablets(stats.getMergeInfo());
-                  else
-                    mergeMetadataRecords(stats.getMergeInfo());
-                  setMergeState(stats.getMergeInfo(), update = MergeState.COMPLETE);
-                } catch (Exception ex) {
-                  log.error("Unable merge metadata table records", ex);
+          if (update == MergeState.MERGING) {
+            if (stats.verifyMergeConsistency(getConnector(), Master.this)) {
+              try {
+                if (stats.getMergeInfo().isDelete()) {
+                  deleteTablets(stats.getMergeInfo());
+                } else {
+                  mergeMetadataRecords(stats.getMergeInfo());
                 }
+                setMergeState(stats.getMergeInfo(), update = MergeState.COMPLETE);
+              } catch (Exception ex) {
+                log.error("Unable merge metadata table records", ex);
               }
             }
-            if (update == MergeState.COMPLETE)
-              update = MergeState.NONE;
+          }
+          if (update == MergeState.COMPLETE)
+            update = MergeState.NONE;
+          if (update != stats.getMergeInfo().getState()) {
             setMergeState(stats.getMergeInfo(), update);
           }
         } catch (Exception ex) {

Modified: incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java?rev=1238615&r1=1238614&r2=1238615&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java
(original)
+++ incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java
Tue Jan 31 14:33:01 2012
@@ -90,9 +90,14 @@ public class MergeStats {
   
   public MergeState nextMergeState() throws Exception {
     MergeState state = info.getState();
+    log.info("Computing next merge state for " + this.info.getRange() + " which is presently
" + state);
     if (state == MergeState.STARTED) {
       state = MergeState.SPLITTING;
     }
+    if (total == 0) {
+      log.info("failed to see any tablets for this range, ignoring");
+      return state;
+    }
     if (state == MergeState.SPLITTING) {
       log.info(hosted + " are hosted, total " + total);
       if (!info.isDelete() && total == 1) {
@@ -171,9 +176,11 @@ public class MergeStats {
         break;
       }
       verify.update(tls.extent, tls.getState(master.onlineTabletServers()), tls.chopped);
+      // check that the prevRow matches the previous row
       if (pr != null && (tls.extent.getPrevEndRow() == null || !tls.extent.getPrevEndRow().equals(pr)))
         return false;
       pr = tls.extent.getEndRow();
+      // stop when we've seen the tablet just beyond our range
       if (tls.extent.getPrevEndRow() != null && extent.getEndRow() != null &&
tls.extent.getPrevEndRow().compareTo(extent.getEndRow()) > 0) {
         break;
       }



Mime
View raw message