accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject svn commit: r1470734 - in /accumulo/branches/1.5: server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java test/src/test/resources/log4j.properties
Date Mon, 22 Apr 2013 22:12:54 GMT
Author: kturner
Date: Mon Apr 22 22:12:54 2013
New Revision: 1470734

URL: http://svn.apache.org/r1470734
Log:
ACCUMULO-1243 made accumulo more responsive to failed splits

Modified:
    accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
    accumulo/branches/1.5/test/src/test/resources/log4j.properties

Modified: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java?rev=1470734&r1=1470733&r2=1470734&view=diff
==============================================================================
--- accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
(original)
+++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
Mon Apr 22 22:12:54 2013
@@ -124,6 +124,7 @@ import org.apache.accumulo.core.util.Cac
 import org.apache.accumulo.core.util.ColumnFQ;
 import org.apache.accumulo.core.util.Daemon;
 import org.apache.accumulo.core.util.LoggingRunnable;
+import org.apache.accumulo.core.util.Pair;
 import org.apache.accumulo.core.util.ServerServices;
 import org.apache.accumulo.core.util.ServerServices.Service;
 import org.apache.accumulo.core.util.SimpleThreadPool;
@@ -2446,24 +2447,39 @@ public class TabletServer extends Abstra
       Text locationToOpen = null;
       SortedMap<Key,Value> tabletsKeyValues = new TreeMap<Key,Value>();
       try {
-        locationToOpen = verifyTabletInformation(extent, TabletServer.this.getTabletSession(),
tabletsKeyValues, getClientAddressString(), getLock());
+        Pair<Text,KeyExtent> pair = verifyTabletInformation(extent, TabletServer.this.getTabletSession(),
tabletsKeyValues, getClientAddressString(), getLock());
+        locationToOpen = pair.getFirst();
+        if (pair.getSecond() != null) {
+          synchronized (openingTablets) {
+            openingTablets.remove(extent);
+            openingTablets.notifyAll();
+            // it expected that the new extent will overlap the old one... if it does not,
it should not be added to unopenedTablets
+            if (!KeyExtent.findOverlapping(extent, new TreeSet<KeyExtent>(Arrays.asList(pair.getSecond()))).contains(pair.getSecond()))
{
+              throw new IllegalStateException("Fixed split does not overlap " + extent +
" " + pair.getSecond());
+            }
+            unopenedTablets.add(pair.getSecond());
+          }
+          // split was rolled back... try again
+          new AssignmentHandler(pair.getSecond()).run();
+          return;
+        }
       } catch (Exception e) {
         synchronized (openingTablets) {
           openingTablets.remove(extent);
           openingTablets.notifyAll();
         }
         log.warn("Failed to verify tablet " + extent, e);
+        enqueueMasterMessage(new TabletStatusMessage(TabletLoadState.LOAD_FAILURE, extent));
         throw new RuntimeException(e);
       }
 
       if (locationToOpen == null) {
         log.debug("Reporting tablet " + extent + " assignment failure: unable to verify Tablet
Information");
-        enqueueMasterMessage(new TabletStatusMessage(TabletLoadState.LOAD_FAILURE, extent));
         synchronized (openingTablets) {
           openingTablets.remove(extent);
           openingTablets.notifyAll();
         }
-        
+        enqueueMasterMessage(new TabletStatusMessage(TabletLoadState.LOAD_FAILURE, extent));
         return;
       }
 
@@ -2852,7 +2868,7 @@ public class TabletServer extends Abstra
   
   private long totalMinorCompactions;
   
-  private static Text verifyRootTablet(KeyExtent extent, TServerInstance instance) throws
DistributedStoreException, AccumuloException {
+  private static Pair<Text,KeyExtent> verifyRootTablet(KeyExtent extent, TServerInstance
instance) throws DistributedStoreException, AccumuloException {
     ZooTabletStateStore store = new ZooTabletStateStore();
     if (!store.iterator().hasNext()) {
       throw new AccumuloException("Illegal state: location is not set in zookeeper");
@@ -2866,10 +2882,11 @@ public class TabletServer extends Abstra
       throw new AccumuloException("Root tablet already has a location set");
     }
     
-    return new Text(Constants.ZROOT_TABLET);
+    return new Pair<Text,KeyExtent>(new Text(Constants.ZROOT_TABLET), null);
   }
   
-  public static Text verifyTabletInformation(KeyExtent extent, TServerInstance instance,
SortedMap<Key,Value> tabletsKeyValues, String clientAddress,
+  public static Pair<Text,KeyExtent> verifyTabletInformation(KeyExtent extent, TServerInstance
instance, SortedMap<Key,Value> tabletsKeyValues,
+      String clientAddress,
       ZooLock lock) throws AccumuloSecurityException, DistributedStoreException, AccumuloException
{
     
     log.debug("verifying extent " + extent);
@@ -2916,7 +2933,7 @@ public class TabletServer extends Abstra
       KeyExtent fke = MetadataTable.fixSplit(metadataEntry, tabletEntries.get(metadataEntry),
instance, SecurityConstants.getSystemCredentials(), lock);
       
       if (!fke.equals(extent)) {
-        return null;
+        return new Pair<Text,KeyExtent>(null, fke);
       }
       
       // reread and reverify metadata entries now that metadata entries were fixed
@@ -2924,7 +2941,7 @@ public class TabletServer extends Abstra
       return verifyTabletInformation(fke, instance, tabletsKeyValues, clientAddress, lock);
     }
     
-    return new Text(dir.get());
+    return new Pair<Text,KeyExtent>(new Text(dir.get()), null);
   }
   
   static Value checkTabletMetadata(KeyExtent extent, TServerInstance instance, SortedMap<Key,Value>
tabletsKeyValues, Text metadataEntry)

Modified: accumulo/branches/1.5/test/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/test/src/test/resources/log4j.properties?rev=1470734&r1=1470733&r2=1470734&view=diff
==============================================================================
--- accumulo/branches/1.5/test/src/test/resources/log4j.properties (original)
+++ accumulo/branches/1.5/test/src/test/resources/log4j.properties Mon Apr 22 22:12:54 2013
@@ -16,7 +16,7 @@
 log4j.rootLogger=INFO, CA
 log4j.appender.CA=org.apache.log4j.ConsoleAppender
 log4j.appender.CA.layout=org.apache.log4j.PatternLayout
-log4j.appender.CA.layout.ConversionPattern=[%t} %-5p %c %x - %m%n
+log4j.appender.CA.layout.ConversionPattern=%d{ISO8601} [%-8c{2}] %-5p: %m%n
 
 log4j.logger.org.apache.accumulo.core.client.impl.ServerClient=ERROR
 log4j.logger.org.apache.accumulo.core.util.shell.Shell.audit=off



Mime
View raw message