accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1467012 - in /accumulo/trunk: ./ assemble/ core/ examples/ fate/src/main/java/org/apache/accumulo/fate/ fate/src/main/java/org/apache/accumulo/fate/zookeeper/ server/ server/src/main/java/org/apache/accumulo/server/master/ server/src/main/...
Date Thu, 11 Apr 2013 17:59:08 GMT
Author: ecn
Date: Thu Apr 11 17:59:07 2013
New Revision: 1467012

URL: http://svn.apache.org/r1467012
Log:
ACCUMULO-1264 tweak the scan range when looking for !METADATA tablet consistency check; add
!METADATA table merge/split to the randomwalk test

Added:
    accumulo/trunk/test/src/test/java/org/apache/accumulo/test/MetaSplitTest.java
      - copied unchanged from r1467010, accumulo/branches/1.5/test/src/test/java/org/apache/accumulo/test/MetaSplitTest.java
Modified:
    accumulo/trunk/   (props changed)
    accumulo/trunk/assemble/   (props changed)
    accumulo/trunk/core/   (props changed)
    accumulo/trunk/examples/   (props changed)
    accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java   (props changed)
    accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java 
 (props changed)
    accumulo/trunk/server/   (props changed)
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java
    accumulo/trunk/src/   (props changed)
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Merge.java

Propchange: accumulo/trunk/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5:r1467010

Propchange: accumulo/trunk/assemble/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/assemble:r1467010

Propchange: accumulo/trunk/core/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/core:r1467010

Propchange: accumulo/trunk/examples/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/examples:r1467010

Propchange: accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java:r1467010

Propchange: accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java:r1467010

Propchange: accumulo/trunk/server/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/server:r1467010

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java?rev=1467012&r1=1467011&r2=1467012&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java Thu
Apr 11 17:59:07 2013
@@ -1203,6 +1203,7 @@ public class Master implements LiveTServ
       }
       // Handle merge transitions
       if (mergeInfo.getRange() != null) {
+        log.debug("mergeInfo overlaps: " + extent + " " + mergeInfo.overlaps(extent));
         if (mergeInfo.overlaps(extent)) {
           switch (mergeInfo.getState()) {
             case NONE:
@@ -2094,8 +2095,11 @@ public class Master implements LiveTServ
     });
     
     TCredentials systemAuths = SecurityConstants.getSystemCredentials();
-    final TabletStateStore stores[] = {new ZooTabletStateStore(new ZooStore(zroot)), new
RootTabletStateStore(instance, systemAuths, this),
-        new MetaDataStateStore(instance, systemAuths, this)};
+    final TabletStateStore stores[] = {
+        new ZooTabletStateStore(new ZooStore(zroot)), 
+        new RootTabletStateStore(instance, systemAuths, this),
+        new MetaDataStateStore(instance, systemAuths, this)
+    };
     watchers.add(new TabletGroupWatcher(stores[2], null));
     watchers.add(new TabletGroupWatcher(stores[1], watchers.get(0)));
     watchers.add(new TabletGroupWatcher(stores[0], watchers.get(1)));

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java?rev=1467012&r1=1467011&r2=1467012&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/MergeStats.java
Thu Apr 11 17:59:07 2013
@@ -28,6 +28,7 @@ import org.apache.accumulo.core.client.S
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.KeyExtent;
+import org.apache.accumulo.core.data.PartialKey;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.zookeeper.ZooUtil;
@@ -182,11 +183,14 @@ public class MergeStats {
     Text tableId = extent.getTableId();
     Text first = KeyExtent.getMetadataEntry(tableId, start);
     Range range = new Range(first, false, null, true);
-    if (extent.isMeta())
-      range = new Range(Constants.METADATA_ROOT_TABLET_KEYSPACE);
+    if (extent.isMeta()) {
+      // don't go off the root tablet
+      range = new Range(new Key(first).followingKey(PartialKey.ROW), false, Constants.METADATA_ROOT_TABLET_KEYSPACE.getEndKey(),
false);
+    }
     scanner.setRange(range);
     KeyExtent prevExtent = null;
 
+    log.debug("Scanning range " + range);
     for (Entry<Key,Value> entry : scanner) {
       TabletLocationState tls;
       try {
@@ -195,24 +199,30 @@ public class MergeStats {
         log.error(e, e);
         return false;
       }
+      log.debug("consistency check: " + tls + " walogs " + tls.walogs.size());
       if (!tls.extent.getTableId().equals(tableId)) {
         break;
       }
 
       if (!tls.walogs.isEmpty() && verify.getMergeInfo().needsToBeChopped(tls.extent))
{
+        log.debug("failing consistency: needs to be chopped" + 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) {
+          log.debug("failing consistency: prev row is too high " + start);
           return false;
         }
         
-        if (tls.getState(master.onlineTabletServers()) != TabletState.UNASSIGNED)
+        if (tls.getState(master.onlineTabletServers()) != TabletState.UNASSIGNED) {
+          log.debug("failing consistency: assigned or hosted " + tls);
           return false;
+        }
         
       } else if (!tls.extent.isPreviousExtent(prevExtent)) {
+        log.debug("hole in !METADATA");
         return false;
       }
       
@@ -224,6 +234,9 @@ public class MergeStats {
         break;
       }
     }
+    log.debug("chopped " + chopped + " v.chopped " + verify.chopped + 
+        " unassigned " + unassigned + " v.unassigned " + verify.unassigned +
+        " verify.total " + verify.total);
     return chopped == verify.chopped && unassigned == verify.unassigned &&
unassigned == verify.total;
   }
   

Propchange: accumulo/trunk/src/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/src:r1467010

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java?rev=1467012&r1=1467011&r2=1467012&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
Thu Apr 11 17:59:07 2013
@@ -16,11 +16,13 @@
  */
 package org.apache.accumulo.test.randomwalk.concurrent;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
 import java.util.Random;
 import java.util.TreeSet;
 
+import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.client.TableOfflineException;
@@ -38,7 +40,8 @@ public class AddSplits extends Test {
     
     @SuppressWarnings("unchecked")
     List<String> tableNames = (List<String>) state.get("tables");
-    
+    tableNames = new ArrayList<String>(tableNames);
+    tableNames.add(Constants.METADATA_TABLE_NAME);
     String tableName = tableNames.get(rand.nextInt(tableNames.size()));
     
     TreeSet<Text> splits = new TreeSet<Text>();

Modified: accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Merge.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Merge.java?rev=1467012&r1=1467011&r2=1467012&view=diff
==============================================================================
--- accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Merge.java
(original)
+++ accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Merge.java
Thu Apr 11 17:59:07 2013
@@ -16,11 +16,13 @@
  */
 package org.apache.accumulo.test.randomwalk.concurrent;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
 import java.util.Random;
 import java.util.TreeSet;
 
+import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.client.TableOfflineException;
@@ -38,7 +40,8 @@ public class Merge extends Test {
     
     @SuppressWarnings("unchecked")
     List<String> tableNames = (List<String>) state.get("tables");
-    
+    tableNames = new ArrayList<String>(tableNames);
+    tableNames.add(Constants.METADATA_TABLE_NAME);
     String tableName = tableNames.get(rand.nextInt(tableNames.size()));
     
     // TODO need to sometimes do null start and end ranges



Mime
View raw message