incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1244784 - /incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
Date Wed, 15 Feb 2012 23:08:40 GMT
Author: ecn
Date: Wed Feb 15 23:08:40 2012
New Revision: 1244784

URL: http://svn.apache.org/viewvc?rev=1244784&view=rev
Log:
ACCUMULO-393: a server would stay in the badServer list if its lock was removed after we started
tracking it

Modified:
    incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java

Modified: incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java?rev=1244784&r1=1244783&r2=1244784&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
(original)
+++ incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
Wed Feb 15 23:08:40 2012
@@ -1981,7 +1981,8 @@ public class Master implements LiveTServ
   private SortedMap<TServerInstance,TabletServerStatus> gatherTableInformation() {
     long start = System.currentTimeMillis();
     SortedMap<TServerInstance,TabletServerStatus> result = new TreeMap<TServerInstance,TabletServerStatus>();
-    for (TServerInstance server : tserverSet.getCurrentServers()) {
+    Set<TServerInstance> currentServers = tserverSet.getCurrentServers();
+    for (TServerInstance server : currentServers) {
       try {
         TabletServerStatus status = tserverSet.getConnection(server).getTableMap();
         result.put(server, status);
@@ -2004,6 +2005,11 @@ public class Master implements LiveTServ
           tserverSet.remove(server);
         }
       }
+      synchronized (badServers) {
+        Set<TServerInstance> deadBadServers = new HashSet<TServerInstance>(badServers.keySet());
+        deadBadServers.removeAll(currentServers);
+        badServers.entrySet().removeAll(deadBadServers);
+      }
     }
     log.debug(String.format("Finished gathering information from %d servers in %.2f seconds",
result.size(), (System.currentTimeMillis() - start) / 1000.));
     return result;



Mime
View raw message