accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1469907 - in /accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server: master/ master/state/ util/
Date Fri, 19 Apr 2013 15:38:26 GMT
Author: ecn
Date: Fri Apr 19 15:38:26 2013
New Revision: 1469907

URL: http://svn.apache.org/r1469907
Log:
ACCUMULO-1293 defend against the root tablet watch reading the !METADATA table merge status
from zookeeper, defend against reading bad states from the !METADATA table

Modified:
    accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/Master.java
    accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java
    accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/state/MetaDataTableScanner.java
    accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java
    accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/util/FindOfflineTablets.java

Modified: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/Master.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/Master.java?rev=1469907&r1=1469906&r2=1469907&view=diff
==============================================================================
--- accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/Master.java
(original)
+++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/Master.java
Fri Apr 19 15:38:26 2013
@@ -1047,6 +1047,12 @@ public class Master implements LiveTServ
     }
   }
   
+  public MergeInfo getMergeInfo(KeyExtent tablet) {
+    if (tablet.isRootTablet())
+      return new MergeInfo();
+    return getMergeInfo(tablet.getTableId());
+  }
+  
   public MergeInfo getMergeInfo(Text tableId) {
     synchronized (mergeLock) {
       try {
@@ -1320,7 +1326,7 @@ public class Master implements LiveTServ
             Text tableId = tls.extent.getTableId();
             MergeStats mergeStats = mergeStatsCache.get(tableId);
             if (mergeStats == null) {
-              mergeStatsCache.put(tableId, mergeStats = new MergeStats(getMergeInfo(tableId)));
+              mergeStatsCache.put(tableId, mergeStats = new MergeStats(getMergeInfo(tls.extent)));
             }
             TabletGoalState goal = getGoalState(tls, mergeStats.getMergeInfo());
             TServerInstance server = tls.getServer();
@@ -1514,7 +1520,6 @@ public class Master implements LiveTServ
       for (MergeStats stats : mergeStatsCache.values()) {
         try {
           MergeState update = stats.nextMergeState(getConnector(), Master.this);
-          
           // when next state is MERGING, its important to persist this before
           // starting the merge... the verification check that is done before
           // moving into the merging state could fail if merge starts but does

Modified: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java?rev=1469907&r1=1469906&r2=1469907&view=diff
==============================================================================
--- accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java
(original)
+++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java
Fri Apr 19 15:38:26 2013
@@ -99,14 +99,14 @@ public class MergeStats {
     MergeState state = info.getState();
     if (state == MergeState.NONE)
       return state;
+    if (total == 0) {
+      log.trace("failed to see any tablets for this range, ignoring " + info.getRange());
+      return 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 " + info.getRange());
-      return state;
-    }
     if (state == MergeState.SPLITTING) {
       log.info(hosted + " are hosted, total " + total);
       if (!info.isDelete() && total == 1) {

Modified: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/state/MetaDataTableScanner.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/state/MetaDataTableScanner.java?rev=1469907&r1=1469906&r2=1469907&view=diff
==============================================================================
--- accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/state/MetaDataTableScanner.java
(original)
+++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/state/MetaDataTableScanner.java
Fri Apr 19 15:38:26 2013
@@ -112,6 +112,7 @@ public class MetaDataTableScanner implem
     } catch (RuntimeException ex) {
       // something is wrong with the records in the !METADATA table, just skip over it
       log.error(ex, ex);
+      mdScanner.close();
       return null;
     } 
   }

Modified: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java?rev=1469907&r1=1469906&r2=1469907&view=diff
==============================================================================
--- accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java
(original)
+++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/state/TabletStateChangeIterator.java
Fri Apr 19 15:38:26 2013
@@ -119,6 +119,8 @@ public class TabletStateChangeIterator e
       TabletLocationState tls;
       try {
         tls = MetaDataTableScanner.createTabletLocationState(k, v);
+        if (tls == null)
+          return;
       } catch (BadLocationStateException e) {
         // maybe the master can do something with a tablet with bad/inconsistent state
         return;

Modified: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/util/FindOfflineTablets.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/util/FindOfflineTablets.java?rev=1469907&r1=1469906&r2=1469907&view=diff
==============================================================================
--- accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/util/FindOfflineTablets.java
(original)
+++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/util/FindOfflineTablets.java
Fri Apr 19 15:38:26 2013
@@ -65,7 +65,7 @@ public class FindOfflineTablets {
     while (scanner.hasNext()) {
       TabletLocationState locationState = scanner.next();
       TabletState state = locationState.getState(tservers.getCurrentServers());
-      if (state != TabletState.HOSTED && TableManager.getInstance().getTableState(locationState.extent.getTableId().toString())
!= TableState.OFFLINE)
+      if (state != null && state != TabletState.HOSTED && TableManager.getInstance().getTableState(locationState.extent.getTableId().toString())
!= TableState.OFFLINE)
         if (!locationState.extent.equals(Constants.ROOT_TABLET_EXTENT))
           System.out.println(locationState + " is " + state + "  #walogs:" + locationState.walogs.size());
     }



Mime
View raw message