accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1463746 - 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/state/ server/src...
Date Tue, 02 Apr 2013 20:38:44 GMT
Author: ecn
Date: Tue Apr  2 20:38:44 2013
New Revision: 1463746

URL: http://svn.apache.org/r1463746
Log:
ACCUMULO-1113 add some additional state checking when loading the root tablet

Added:
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/IllegalDSException.java
      - copied unchanged from r1463744, accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/state/IllegalDSException.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/state/ZooTabletStateStore.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/log/SortedLogRecovery.java
    accumulo/trunk/src/   (props changed)

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

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

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

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

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:r1463744

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:r1463744

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

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/ZooTabletStateStore.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/ZooTabletStateStore.java?rev=1463746&r1=1463745&r2=1463746&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/ZooTabletStateStore.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/state/ZooTabletStateStore.java
Tue Apr  2 20:38:44 2013
@@ -123,6 +123,11 @@ public class ZooTabletStateStore extends
     if (assignment.tablet.compareTo(Constants.ROOT_TABLET_EXTENT) != 0)
       throw new IllegalArgumentException("You can only store the root tablet location");
     String value = AddressUtil.toString(assignment.server.getLocation()) + "|" + assignment.server.getSession();
+    Iterator<TabletLocationState> currentIter = iterator();
+    TabletLocationState current = currentIter.next();
+    if (current.current != null) {
+      throw new IllegalDSException("Trying to set the root tablet location: it is already
set to " + current.current);
+    }
     store.put(Constants.ZROOT_TABLET_FUTURE_LOCATION, value.getBytes());
   }
   
@@ -134,8 +139,17 @@ public class ZooTabletStateStore extends
     if (assignment.tablet.compareTo(Constants.ROOT_TABLET_EXTENT) != 0)
       throw new IllegalArgumentException("You can only store the root tablet location");
     String value = AddressUtil.toString(assignment.server.getLocation()) + "|" + assignment.server.getSession();
+    Iterator<TabletLocationState> currentIter = iterator();
+    TabletLocationState current = currentIter.next();
+    if (current.current != null) {
+      throw new IllegalDSException("Trying to set the root tablet location: it is already
set to " + current.current);
+    }
+    if (!current.future.equals(assignment.server)) {
+      throw new IllegalDSException("Root tablet is already assigned to " + current.future);
+    }
     store.put(Constants.ZROOT_TABLET_LOCATION, value.getBytes());
     store.put(Constants.ZROOT_TABLET_LAST_LOCATION, value.getBytes());
+    // Make the following unnecessary by making the entire update atomic 
     store.remove(Constants.ZROOT_TABLET_FUTURE_LOCATION);
     log.debug("Put down root tablet location");
   }

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/log/SortedLogRecovery.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/log/SortedLogRecovery.java?rev=1463746&r1=1463745&r2=1463746&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/log/SortedLogRecovery.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/log/SortedLogRecovery.java
Tue Apr  2 20:38:44 2013
@@ -133,7 +133,7 @@ public class SortedLogRecovery {
           log.warn("Ignoring error closing file");
         }
       }
-      log.info("Recovery complete for " + logfile);
+      log.info("Recovery complete for " + extent + " using " + logfile);
     }
   }
   

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



Mime
View raw message