hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1502014 - in /hbase/trunk/hbase-server/src: main/java/org/apache/hadoop/hbase/master/ test/java/org/apache/hadoop/hbase/client/ test/java/org/apache/hadoop/hbase/master/
Date Wed, 10 Jul 2013 21:35:53 GMT
Author: stack
Date: Wed Jul 10 21:35:53 2013
New Revision: 1502014

URL: http://svn.apache.org/r1502014
Log:
HBASE-8922 TestAdmin.testForceSplitMultiFamily fails in hadoopqa; DEBUG; REVERT -- OVERCOMMIT

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java?rev=1502014&r1=1502013&r2=1502014&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Wed Jul 10 21:35:53 2013
@@ -257,7 +257,7 @@ public class AssignmentManager extends Z
     this.balancer = balancer;
     int maxThreads = conf.getInt("hbase.assignment.threads.max", 30);
     this.threadPoolExecutorService = Threads.getBoundedCachedThreadPool(
-      maxThreads, 60L, TimeUnit.SECONDS, Threads.newDaemonThreadFactory("AM."));
+      maxThreads, 60L, TimeUnit.SECONDS, Threads.newDaemonThreadFactory("hbase-am"));
     this.metricsMaster = metricsMaster;// can be null only with tests.
     this.regionStates = new RegionStates(server, serverManager);
 
@@ -267,7 +267,7 @@ public class AssignmentManager extends Z
     this.bulkAssignThresholdServers = conf.getInt("hbase.bulk.assignment.threshold.servers",
3);
 
     int workers = conf.getInt("hbase.assignment.zkevent.workers", 20);
-    ThreadFactory threadFactory = Threads.newDaemonThreadFactory("AM.ZK.Worker");
+    ThreadFactory threadFactory = Threads.newDaemonThreadFactory("hbase-am-zkevent-worker");
     zkEventWorkers = Threads.getBoundedCachedThreadPool(workers, 60L,
             TimeUnit.SECONDS, threadFactory);
     this.tableLockManager = tableLockManager;
@@ -544,7 +544,7 @@ public class AssignmentManager extends Z
     final ServerName sn = rt.getServerName();
     final String encodedRegionName = regionInfo.getEncodedName();
     final String prettyPrintedRegionName = HRegionInfo.prettyPrint(encodedRegionName);
-    LOG.info("Processing " + regionInfo.getRegionNameAsString() + " in state " + et);
+    LOG.info("Processing region " + regionInfo.getRegionNameAsString() + " in state " + et);
 
 
     if (regionStates.isRegionInTransition(encodedRegionName)) {
@@ -640,15 +640,16 @@ public class AssignmentManager extends Z
               " on a dead regionserver: " + sn + " doing nothing");
         } else {
           regionStates.updateRegionState(rt, RegionState.State.SPLITTING);
-          LOG.info("Processed " + prettyPrintedRegionName + " in state : " + et);
+          LOG.info("Processed region " + prettyPrintedRegionName
+            + " in state : " + et);
         }
         break;
       case RS_ZK_REGION_SPLIT:
         if (!serverManager.isServerOnline(sn)) {
           forceOffline(regionInfo, rt);
         } else {
-          LOG.info("Processed " + prettyPrintedRegionName + " in state : " + et +
-            " nothing to do.");
+          LOG.info("Processed region " + prettyPrintedRegionName + " in state : " +
+              et + " nothing to do.");
           // We don't do anything. The regionserver is supposed to update the znode
           // multiple times so if it's still up we will receive an update soon.
         }
@@ -658,7 +659,7 @@ public class AssignmentManager extends Z
           // The regionserver started the merge, but died before updating the status.
           // It means (hopefully) that the merge was not finished
           // This node should be gone soon since it is ephemeral.
-          LOG.warn("Processed " + prettyPrintedRegionName + " in state : " + et +
+          LOG.warn("Processed region " + prettyPrintedRegionName + " in state : " + et +
               " on a dead regionserver: " + sn + " doing nothing");
         } else {
           handleRegionMerging(rt, prettyPrintedRegionName, sn);
@@ -669,11 +670,11 @@ public class AssignmentManager extends Z
       case RS_ZK_REGION_MERGED:
         if (!serverManager.isServerOnline(sn)) {
           // ServerShutdownHandler would handle this region
-          LOG.warn("Processed " + prettyPrintedRegionName
+          LOG.warn("Processed region " + prettyPrintedRegionName
               + " in state : " + et + " on a dead regionserver: " + sn
               + " doing nothing");
         } else {
-          LOG.info("Processed " + prettyPrintedRegionName + " in state : " +
+          LOG.info("Processed region " + prettyPrintedRegionName + " in state : " +
               et + " nothing to do.");
           // We don't do anything. The regionserver is supposed to update the znode
           // multiple times so if it's still up we will receive an update soon.
@@ -880,7 +881,7 @@ public class AssignmentManager extends Z
           // times after already being in state of CLOSING
           if (regionState != null
               && !regionState.isPendingCloseOrClosingOnServer(sn)) {
-            LOG.warn("Received CLOSING for " + prettyPrintedRegionName
+            LOG.warn("Received CLOSING for region " + prettyPrintedRegionName
               + " from server " + sn + " but region was in the state " + regionState
               + " and not in expected PENDING_CLOSE or CLOSING states,"
               + " or not on the expected server");
@@ -894,7 +895,7 @@ public class AssignmentManager extends Z
           // Should see CLOSED after CLOSING but possible after PENDING_CLOSE
           if (regionState != null
               && !regionState.isPendingCloseOrClosingOnServer(sn)) {
-            LOG.warn("Received CLOSED for " + prettyPrintedRegionName
+            LOG.warn("Received CLOSED for region " + prettyPrintedRegionName
               + " from server " + sn + " but region was in the state " + regionState
               + " and not in expected PENDING_CLOSE or CLOSING states,"
               + " or not on the expected server");
@@ -914,7 +915,7 @@ public class AssignmentManager extends Z
         case RS_ZK_REGION_FAILED_OPEN:
           if (regionState != null
               && !regionState.isPendingOpenOrOpeningOnServer(sn)) {
-            LOG.warn("Received FAILED_OPEN for " + prettyPrintedRegionName
+            LOG.warn("Received FAILED_OPEN for region " + prettyPrintedRegionName
               + " from server " + sn + " but region was in the state " + regionState
               + " and not in expected PENDING_OPEN or OPENING states,"
               + " or not on the expected server");
@@ -952,7 +953,7 @@ public class AssignmentManager extends Z
           // times after already being in state of OPENING
           if (regionState != null
               && !regionState.isPendingOpenOrOpeningOnServer(sn)) {
-            LOG.warn("Received OPENING for " + prettyPrintedRegionName
+            LOG.warn("Received OPENING for region " + prettyPrintedRegionName
               + " from server " + sn + " but region was in the state " + regionState
               + " and not in expected PENDING_OPEN or OPENING states,"
               + " or not on the expected server");
@@ -966,7 +967,7 @@ public class AssignmentManager extends Z
           // Should see OPENED after OPENING but possible after PENDING_OPEN
           if (regionState != null
               && !regionState.isPendingOpenOrOpeningOnServer(sn)) {
-            LOG.warn("Received OPENED for " + prettyPrintedRegionName
+            LOG.warn("Received OPENED for region " + prettyPrintedRegionName
               + " from server " + sn + " but region was in the state " + regionState
               + " and not in expected PENDING_OPEN or OPENING states,"
               + " or not on the expected server");
@@ -1215,22 +1216,22 @@ public class AssignmentManager extends Z
 
             HRegionInfo regionInfo = rs.getRegion();
             String regionNameStr = regionInfo.getRegionNameAsString();
-            LOG.debug("The znode of " + regionNameStr
+            LOG.debug("The znode of region " + regionNameStr
               + " has been deleted, region state: " + rs);
             if (rs.isOpened()) {
               ServerName serverName = rs.getServerName();
               regionOnline(regionInfo, serverName);
-              LOG.info("The master has opened "
+              LOG.info("The master has opened the region "
                 + regionNameStr + " that was online on " + serverName);
               boolean disabled = getZKTable().isDisablingOrDisabledTable(
                 regionInfo.getTableNameAsString());
               if (!serverManager.isServerOnline(serverName) && !disabled) {
-                LOG.info("Opened " + regionNameStr
+                LOG.info("Opened region " + regionNameStr
                   + "but the region server is offline, reassign the region");
                 assign(regionInfo, true);
               } else if (disabled) {
                 // if server is offline, no hurt to unassign again
-                LOG.info("Opened " + regionNameStr
+                LOG.info("Opened region " + regionNameStr
                   + "but this table is disabled, triggering close of region");
                 unassign(regionInfo);
               }
@@ -1990,7 +1991,7 @@ public class AssignmentManager extends Z
     // Remove region from in-memory transition and unassigned node from ZK
     // While trying to enable the table the regions of the table were
     // already enabled.
-    LOG.debug("ALREADY_OPENED " + region.getRegionNameAsString()
+    LOG.debug("ALREADY_OPENED region " + region.getRegionNameAsString()
         + " to " + sn);
     String encodedRegionName = region.getEncodedName();
     try {
@@ -2080,7 +2081,7 @@ public class AssignmentManager extends Z
       serverManager.createDestinationServersList(serverToExclude);
 
     if (destServers.isEmpty()){
-      LOG.warn("Can't move " + encodedName +
+      LOG.warn("Can't move the region " + encodedName +
         ", there is no destination server available.");
       return null;
     }
@@ -2120,7 +2121,7 @@ public class AssignmentManager extends Z
 
     if (newPlan) {
       if (randomPlan.getDestination() == null) {
-        LOG.warn("Can't find a destination for " + encodedName);
+        LOG.warn("Can't find a destination for region" + encodedName);
         return null;
       }
       LOG.debug("No previous transition plan was found (or we are ignoring " +
@@ -2132,7 +2133,7 @@ public class AssignmentManager extends Z
                ", forceNewPlan=" + forceNewPlan);
         return randomPlan;
       }
-    LOG.debug("Using pre-existing plan for " +
+    LOG.debug("Using pre-existing plan for region " +
       region.getRegionNameAsString() + "; plan=" + existingPlan);
     return existingPlan;
   }
@@ -2202,7 +2203,8 @@ public class AssignmentManager extends Z
    */
   public void unassign(HRegionInfo region, boolean force, ServerName dest) {
     // TODO: Method needs refactoring.  Ugly buried returns throughout.  Beware!
-    LOG.debug("Starting unassign of " + region.getRegionNameAsString() + " (offlining)");
+    LOG.debug("Starting unassignment of region " +
+      region.getRegionNameAsString() + " (offlining)");
 
     String encodedName = region.getEncodedName();
     // Grab the state of this region and synchronize on it
@@ -2225,7 +2227,7 @@ public class AssignmentManager extends Z
           versionOfClosingNode = ZKAssign.createNodeClosing(
             watcher, region, state.getServerName());
           if (versionOfClosingNode == -1) {
-            LOG.debug("Attempting to unassign " +
+            LOG.debug("Attempting to unassign region " +
                 region.getRegionNameAsString() + " but ZK closing node "
                 + "can't be created.");
             return;
@@ -2266,7 +2268,7 @@ public class AssignmentManager extends Z
         return;
       } else if (force && (state.isPendingClose()
           || state.isClosing() || state.isFailedClose())) {
-        LOG.debug("Attempting to unassign " + region.getRegionNameAsString() +
+        LOG.debug("Attempting to unassign region " + region.getRegionNameAsString() +
           " which is already " + state.getState()  +
           " but forcing to send a CLOSE RPC again ");
         if (state.isFailedClose()) {
@@ -2274,7 +2276,7 @@ public class AssignmentManager extends Z
         }
         state.updateTimestampToNow();
       } else {
-        LOG.debug("Attempting to unassign " +
+        LOG.debug("Attempting to unassign region " +
           region.getRegionNameAsString() + " but it is " +
           "already in transition (" + state.getState() + ", force=" + force + ")");
         return;
@@ -2303,12 +2305,12 @@ public class AssignmentManager extends Z
         // TODO : We don't abort if the delete node returns false. Is there any
         // such corner case?
         if (!deleteNode) {
-          LOG.error("The deletion of the CLOSED node for "
+          LOG.error("The deletion of the CLOSED node for the region "
             + encodedName + " returned " + deleteNode);
         }
       }
     } catch (NoNodeException e) {
-      LOG.debug("CLOSING/CLOSED node for " + encodedName
+      LOG.debug("CLOSING/CLOSED node for the region " + encodedName
         + " already deleted");
     } catch (KeeperException ke) {
       server.abort(
@@ -2794,7 +2796,7 @@ public class AssignmentManager extends Z
     while (!this.server.isStopped() && regionStates.isRegionInTransition(hri)) {
       regionStates.waitForUpdate(100);
       if (EnvironmentEdgeManager.currentTimeMillis() > end) {
-        LOG.info("Timed out on waiting for " + hri.getEncodedName() + " to be assigned.");
+        LOG.info("Timed out on waiting for region:" + hri.getEncodedName() + " to be assigned.");
         return false;
       }
     }
@@ -3067,7 +3069,7 @@ public class AssignmentManager extends Z
           regionStates.getRegionTransitionState(encodedName);
         if (regionState == null
             || !regionState.isPendingOpenOrOpeningOnServer(sn)) {
-          LOG.info("Skip " + hri
+          LOG.info("Skip region " + hri
             + " since it is not opening on the dead server any more: " + sn);
           it.remove();
         } else {

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java?rev=1502014&r1=1502013&r2=1502014&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java
Wed Jul 10 21:35:53 2013
@@ -262,7 +262,7 @@ public class RegionStates {
       hri, state, System.currentTimeMillis(), newServerName);
     RegionState oldState = regionStates.put(regionName, regionState);
     if (oldState == null || oldState.getState() != regionState.getState()) {
-      LOG.info("Transitioned from " + oldState + " to " + regionState);
+      LOG.info("Region transitioned from " + oldState + " to " + regionState);
     }
     if (newServerName != null || (
         state != State.PENDING_CLOSE && state != State.CLOSING)) {
@@ -298,7 +298,7 @@ public class RegionStates {
 
     ServerName oldServerName = regionAssignments.put(hri, serverName);
     if (!serverName.equals(oldServerName)) {
-      LOG.info("Onlined " + hri.getShortNameToLog() + " on " + serverName);
+      LOG.info("Onlined region " + hri.getShortNameToLog() + " on " + serverName);
       Set<HRegionInfo> regions = serverHoldings.get(serverName);
       if (regions == null) {
         regions = new HashSet<HRegionInfo>();
@@ -306,7 +306,7 @@ public class RegionStates {
       }
       regions.add(hri);
       if (oldServerName != null) {
-        LOG.info("Offlined " + hri.getShortNameToLog() + " from " + oldServerName);
+        LOG.info("Offlined region " + hri.getShortNameToLog() + " from " + oldServerName);
         serverHoldings.get(oldServerName).remove(hri);
       }
     }
@@ -333,7 +333,7 @@ public class RegionStates {
 
     ServerName oldServerName = regionAssignments.remove(hri);
     if (oldServerName != null) {
-      LOG.info("Offlined " + hri.getShortNameToLog() + " from " + oldServerName);
+      LOG.info("Offlined region " + hri.getShortNameToLog() + " from " + oldServerName);
       serverHoldings.get(oldServerName).remove(hri);
     }
   }
@@ -361,7 +361,7 @@ public class RegionStates {
         // Region is open on this region server, but in transition.
         // This region must be moving away from this server, or splitting/merging.
         // SSH will handle it, either skip assigning, or re-assign.
-        LOG.info("Transitioning " + state + " will be handled by SSH for " + sn);
+        LOG.info("Transitioning region " + state + " will be handled by SSH for " + sn);
         if (state.isSplitting() || state.isMerging()) {
           LOG.info("Offline splitting/merging region " + state);
           try {

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java?rev=1502014&r1=1502013&r2=1502014&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java (original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java Wed
Jul 10 21:35:53 2013
@@ -927,12 +927,7 @@ public class TestAdmin {
 
   void splitTest(byte[] splitPoint, byte[][] familyNames, int[] rowCounts,
     int numVersions, int blockSize) throws Exception {
-    StringBuilder sb = new StringBuilder();
-    // Add tail to String so can see better in logs where a test is running.
-    for (int i = 0; i < rowCounts.length; i++) {
-      sb.append("_").append(Integer.toString(rowCounts[i]));
-    }
-    byte [] tableName = Bytes.toBytes("testForceSplit" + sb.toString());
+    byte [] tableName = Bytes.toBytes("testForceSplit");
     assertFalse(admin.tableExists(tableName));
     final HTable table = TEST_UTIL.createTable(tableName, familyNames,
       numVersions, blockSize);
@@ -959,7 +954,7 @@ public class TestAdmin {
 
     // get the initial layout (should just be one region)
     Map<HRegionInfo, ServerName> m = table.getRegionLocations();
-    LOG.info("Initial regions (" + m.size() + "): " + m);
+    System.out.println("Initial regions (" + m.size() + "): " + m);
     assertTrue(m.size() == 1);
 
     // Verify row count
@@ -999,10 +994,7 @@ public class TestAdmin {
           }
           if (regions == null) continue;
           count.set(regions.size());
-          if (count.get() >= 2) {
-            LOG.info("Found: " + regions);
-            break;
-          }
+          if (count.get() >= 2) break;
           LOG.debug("Cycle waiting on split");
         }
         LOG.debug("CheckForSplit thread exited, current region count: " + count.get());
@@ -1046,8 +1038,7 @@ public class TestAdmin {
         // check if splitKey is based on the largest column family
         // in terms of it store size
         int deltaForLargestFamily = Math.abs(rowCount/2 - splitKey);
-        LOG.debug("SplitKey=" + splitKey + "&deltaForLargestFamily=" + deltaForLargestFamily
+
-          ", r=" + r[0]);
+        LOG.debug("SplitKey=" + splitKey + "&deltaForLargestFamily=" + deltaForLargestFamily);
         for (int index = 0; index < familyNames.length; index++) {
           int delta = Math.abs(rowCounts[index]/2 - splitKey);
           if (delta < deltaForLargestFamily) {

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java?rev=1502014&r1=1502013&r2=1502014&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java
Wed Jul 10 21:35:53 2013
@@ -97,7 +97,6 @@ public class TestZKBasedOpenCloseRegion 
 
     }
     waitUntilAllRegionsAssigned();
-    waitOnRIT();
   }
 
   /**
@@ -318,18 +317,6 @@ public class TestZKBasedOpenCloseRegion 
     LOG.info("Done with testCloseRegion");
   }
 
-  private void waitOnRIT() {
-    // Close worked but we are going to open the region elsewhere.  Before going on, make
sure
-    // this completes.
-    while (TEST_UTIL.getHBaseCluster().getMaster().getAssignmentManager().
-        getRegionStates().isRegionsInTransition()) {
-      LOG.info("Waiting on regions in transition: " +
-        TEST_UTIL.getHBaseCluster().getMaster().getAssignmentManager().
-          getRegionStates().getRegionsInTransition());
-      Threads.sleep(10);
-    }
-  }
-
   /**
    * If region open fails with IOException in openRegion() while doing tableDescriptors.get()
    * the region should not add into regionsInTransitionInRS map
@@ -356,7 +343,8 @@ public class TestZKBasedOpenCloseRegion 
 
   private static void waitUntilAllRegionsAssigned()
   throws IOException {
-    HTable meta = new HTable(TEST_UTIL.getConfiguration(), HConstants.META_TABLE_NAME);
+    HTable meta = new HTable(TEST_UTIL.getConfiguration(),
+      HConstants.META_TABLE_NAME);
     while (true) {
       int rows = 0;
       Scan scan = new Scan();



Mime
View raw message