accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1359182 - in /accumulo/branches/1.4: ./ src/ src/core/ src/server/ src/server/src/main/java/org/apache/accumulo/server/master/Master.java test/system/auto/simple/shutdown.py
Date Mon, 09 Jul 2012 14:15:00 GMT
Author: ecn
Date: Mon Jul  9 14:15:00 2012
New Revision: 1359182

URL: http://svn.apache.org/viewvc?rev=1359182&view=rev
Log:
ACCUMULO-676 merge to 1.4 branch

Modified:
    accumulo/branches/1.4/   (props changed)
    accumulo/branches/1.4/src/   (props changed)
    accumulo/branches/1.4/src/core/   (props changed)
    accumulo/branches/1.4/src/server/   (props changed)
    accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
    accumulo/branches/1.4/test/system/auto/simple/shutdown.py

Propchange: accumulo/branches/1.4/
------------------------------------------------------------------------------
  Merged /accumulo/branches/ACCUMULO-672:r1359163

Propchange: accumulo/branches/1.4/src/
------------------------------------------------------------------------------
  Merged /accumulo/branches/ACCUMULO-672:r1359163
  Merged /accumulo/branches/ACCUMULO-672/src:r1359163

Propchange: accumulo/branches/1.4/src/core/
------------------------------------------------------------------------------
  Merged /accumulo/branches/ACCUMULO-672/core:r1359163

Propchange: accumulo/branches/1.4/src/server/
------------------------------------------------------------------------------
  Merged /accumulo/branches/ACCUMULO-672/server:r1359163

Modified: accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java?rev=1359182&r1=1359181&r2=1359182&view=diff
==============================================================================
--- accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
(original)
+++ accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
Mon Jul  9 14:15:00 2012
@@ -1263,10 +1263,13 @@ public class Master implements LiveTServ
   private class TabletGroupWatcher extends Daemon {
     
     final TabletStateStore store;
+    final TabletGroupWatcher dependentWatcher;
+    
     final TableStats stats = new TableStats();
     
-    TabletGroupWatcher(TabletStateStore store) {
+    TabletGroupWatcher(TabletStateStore store, TabletGroupWatcher dependentWatcher) {
       this.store = store;
+      this.dependentWatcher = dependentWatcher;
     }
     
     Map<Text,TableCounts> getStats() {
@@ -1346,6 +1349,15 @@ public class Master implements LiveTServ
               goal = TabletGoalState.HOSTED;
             }
             
+            // if we are shutting down all the tabletservers, we have to do it in order
+            if (goal == TabletGoalState.UNASSIGNED && state == TabletState.HOSTED)
{
+              if (serversToShutdown.equals(currentTServers.keySet())) {
+                if (dependentWatcher != null && dependentWatcher.assignedOrHosted()
> 0) {
+                  goal = TabletGoalState.HOSTED;
+                }
+              }
+            }
+            
             if (goal == TabletGoalState.HOSTED) {
               if (state != TabletState.HOSTED && !tls.walogs.isEmpty()) {
                 if (!recovery.recover(SecurityConstants.getSystemCredentials(), tls.extent,
tls.walogs, Master.this)) {
@@ -1438,6 +1450,14 @@ public class Master implements LiveTServ
       }
     }
     
+    private int assignedOrHosted() {
+      int result = 0;
+      for (TableCounts counts : stats.getLast().values()) {
+        result += counts.assigned() + counts.hosted();
+      }
+      return result;
+    }
+
     private void sendSplitRequest(MergeInfo info, TabletState state, TabletLocationState
tls) {
       // Already split?
       if (!info.getState().equals(MergeState.SPLITTING))
@@ -2066,9 +2086,9 @@ public class Master implements LiveTServ
     AuthInfo systemAuths = SecurityConstants.getSystemCredentials();
     final TabletStateStore stores[] = {new ZooTabletStateStore(new ZooStore(zroot)), new
RootTabletStateStore(instance, systemAuths, this),
         new MetaDataStateStore(instance, systemAuths, this)};
-    for (int i = 0; i < stores.length; i++) {
-      watchers.add(new TabletGroupWatcher(stores[i]));
-    }
+    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)));
     for (TabletGroupWatcher watcher : watchers) {
       watcher.start();
     }

Modified: accumulo/branches/1.4/test/system/auto/simple/shutdown.py
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/test/system/auto/simple/shutdown.py?rev=1359182&r1=1359181&r2=1359182&view=diff
==============================================================================
--- accumulo/branches/1.4/test/system/auto/simple/shutdown.py (original)
+++ accumulo/branches/1.4/test/system/auto/simple/shutdown.py Mon Jul  9 14:15:00 2012
@@ -19,9 +19,10 @@ import logging
 import unittest
 import sleep
 import signal
+import socket
 from subprocess import PIPE
 
-from TestUtils import TestUtilsMixin, ROOT, ROOT_PASSWORD
+from TestUtils import TestUtilsMixin, ROOT, ROOT_PASSWORD, FUZZ
 from simple.readwrite import SunnyDayTest
 
 log = logging.getLogger('test.auto')
@@ -76,14 +77,24 @@ class ShutdownDuringDeleteTable(TestUtil
         handle.stdin.write(dt)
         self.shutdown_accumulo()
 
-class ShutdownDuringStart(TestUtilsMixin, unittest.TestCase):
+class AdminStopDuringStart(TestUtilsMixin, unittest.TestCase):
 
     order = SunnyDayTest.order + 1
     
     def runTest(self):
-        self.hosts = self.options.hosts
         self.clean_accumulo(self.masterHost())
         self.start_accumulo()
+        handle = self.runOn(self.masterHost(),
+                            [self.accumulo_sh(),'admin','stop', socket.getfqdn() + ":%d"
% (39000 + FUZZ)])
+
+class AdminStop(SunnyDayTest):
+
+    order = SunnyDayTest.order + 1
+    
+    def runTest(self):
+        self.waitForStop(self.ingester, self.waitTime())
+        handle = self.runOn(self.masterHost(),
+                            [self.accumulo_sh(),'admin','stop', socket.getfqdn() + ":%d"
% (39000 + FUZZ)])
         self.shutdown_accumulo()
 
 def suite():
@@ -92,5 +103,6 @@ def suite():
     result.addTest(ShutdownDuringQuery())
     result.addTest(ShutdownDuringDelete())
     result.addTest(ShutdownDuringDeleteTable())
-    result.addTest(ShutdownDuringStart())
+    result.addTest(AdminStopDuringStart())
+    result.addTest(AdminStop())
     return result



Mime
View raw message