incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1294787 - /incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
Date Tue, 28 Feb 2012 19:00:57 GMT
Author: ecn
Date: Tue Feb 28 19:00:56 2012
New Revision: 1294787

URL: http://svn.apache.org/viewvc?rev=1294787&view=rev
Log:
ACCUMULO-329 detect expiring migrations when tablets are assigned to bad servers

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=1294787&r1=1294786&r2=1294787&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
Tue Feb 28 19:00:56 2012
@@ -1359,13 +1359,22 @@ public class Master implements LiveTServ
                   break;
                 case ASSIGNED_TO_DEAD_SERVER:
                   assignedToDeadServers.add(tls);
-                  log.info("Current servers " + currentTServers.keySet());
+                  if (server.equals(migrations.get(tls.extent)))
+                    migrations.remove(tls.extent);
+                  // log.info("Current servers " + currentTServers.keySet());
                   break;
                 case UNASSIGNED:
                   // maybe it's a finishing migration
                   TServerInstance dest = migrations.get(tls.extent);
-                  if (dest != null && destinations.keySet().contains(dest)) {
-                    assignments.add(new Assignment(tls.extent, dest));
+                  if (dest != null) {
+                    // if destination is still good, assign it
+                    if (destinations.keySet().contains(dest)) {
+                      assignments.add(new Assignment(tls.extent, dest));
+                    } else {
+                      // get rid of this migration
+                      migrations.remove(tls.extent);
+                      unassigned.put(tls.extent, server);
+                    }
                   } else {
                     unassigned.put(tls.extent, server);
                   }
@@ -1381,7 +1390,7 @@ public class Master implements LiveTServ
                   break;
                 case ASSIGNED_TO_DEAD_SERVER:
                   assignedToDeadServers.add(tls);
-                  log.info("Current servers " + currentTServers.keySet());
+                  // log.info("Current servers " + currentTServers.keySet());
                   break;
                 case HOSTED:
                   TServerConnection conn = tserverSet.getConnection(server);
@@ -1806,15 +1815,7 @@ public class Master implements LiveTServ
           found.add(extent);
         }
       }
-      Set<KeyExtent> notFound = new HashSet<KeyExtent>();
-      synchronized (migrations) {
-        notFound.addAll(migrations.keySet());
-      }
-      notFound.removeAll(found);
-      for (KeyExtent extent : notFound) {
-        log.info("Canceling migration of " + extent + " to " + migrations.get(extent) + ":
tablet no longer exists (probably due to a split)");
-        migrations.remove(extent);
-      }
+      migrations.keySet().retainAll(found);
     }
   }
   



Mime
View raw message