hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1163419 - in /hbase/branches/0.90: CHANGES.txt src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java src/main/java/org/apache/hadoop/hbase/master/handler/OpenedRegionHandler.java
Date Tue, 30 Aug 2011 21:51:34 GMT
Author: todd
Date: Tue Aug 30 21:51:34 2011
New Revision: 1163419

URL: http://svn.apache.org/viewvc?rev=1163419&view=rev
Log:
HBASE-4276  AssignmentManager debug logs should be at INFO level for META/ROOT regions.

Modified:
    hbase/branches/0.90/CHANGES.txt
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/OpenedRegionHandler.java

Modified: hbase/branches/0.90/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1163419&r1=1163418&r2=1163419&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Tue Aug 30 21:51:34 2011
@@ -36,6 +36,8 @@ Release 0.90.5 - Unreleased
    HBASE-4222  Make HLog more resilient to write pipeline failures
    HBASE-4293  More verbose logging in ServerShutdownHandler for meta/root
                cases (todd)
+   HBASE-4276  AssignmentManager debug logs should be at INFO level for
+               META/ROOT regions (todd)
  
 Release 0.90.4 - August 10, 2011
   BUG FIXES

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java?rev=1163419&r1=1163418&r2=1163419&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
(original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Tue Aug 30 21:51:34 2011
@@ -279,7 +279,7 @@ public class AssignmentManager extends Z
     boolean intransistion =
       processRegionInTransition(hri.getEncodedName(), hri, null);
     if (!intransistion) return intransistion;
-    LOG.debug("Waiting on " + HRegionInfo.prettyPrint(hri.getEncodedName()));
+    debugLog(hri, "Waiting on " + HRegionInfo.prettyPrint(hri.getEncodedName()));
     synchronized(this.regionsInTransition) {
       while (!this.master.isStopped() &&
           this.regionsInTransition.containsKey(hri.getEncodedName())) {
@@ -407,7 +407,7 @@ public class AssignmentManager extends Z
   throws KeeperException {
     // If was on dead server, its closed now.  Force to OFFLINE and then
     // handle it like a close; this will get it reassigned if appropriate
-    LOG.debug("RIT " + hri.getEncodedName() + " in state=" +
+    debugLog(hri, "RIT " + hri.getEncodedName() + " in state=" +
       oldData.getEventType() + " was on deadserver; forcing offline");
     ZKAssign.createOrForceNodeOffline(this.watcher, hri,
       this.master.getServerName());
@@ -1041,7 +1041,8 @@ public class AssignmentManager extends Z
       RegionPlan plan = getRegionPlan(state, forceNewPlan);
       if (plan == null) return; // Should get reassigned later when RIT times out.
       try {
-        LOG.debug("Assigning region " + state.getRegion().getRegionNameAsString() +
+        debugLog(state.getRegion(),
+          "Assigning region " + state.getRegion().getRegionNameAsString() +
           " to " + plan.getDestination().getServerName());
         // Transition RegionState to PENDING_OPEN
         state.update(RegionState.State.PENDING_OPEN);
@@ -1068,6 +1069,14 @@ public class AssignmentManager extends Z
     }
   }
 
+  private void debugLog(HRegionInfo region, String string) {
+    if (region.isMetaTable() || region.isRootRegion()) {
+      LOG.info(string);
+    } else {
+      LOG.debug(string);
+    }
+  }
+
   /**
    * Set region as OFFLINED up in zookeeper
    * @param state
@@ -1163,7 +1172,7 @@ public class AssignmentManager extends Z
       }
     }
     if (newPlan) {
-      LOG.debug("No previous transition plan was found (or we are ignoring " +
+      debugLog(state.getRegion(), "No previous transition plan was found (or we are ignoring
" +
         "an existing plan) for " + state.getRegion().getRegionNameAsString() +
         " so generated a random one; " + randomPlan + "; " +
         serverManager.countOfRegionServers() +
@@ -1171,7 +1180,7 @@ public class AssignmentManager extends Z
         ", exclude=" + serverToExclude + ") available servers");
         return randomPlan;
       }
-      LOG.debug("Using pre-existing plan for region " +
+      debugLog(state.getRegion(), "Using pre-existing plan for region " +
         state.getRegion().getRegionNameAsString() + "; plan=" + existingPlan);
       return existingPlan;
   }
@@ -1200,12 +1209,12 @@ public class AssignmentManager extends Z
    * @param force if region should be closed even if already closing
    */
   public void unassign(HRegionInfo region, boolean force) {
-    LOG.debug("Starting unassignment of region " +
+    debugLog(region, "Starting unassignment of region " +
       region.getRegionNameAsString() + " (offlining)");
     synchronized (this.regions) {
       // Check if this region is currently assigned
       if (!regions.containsKey(region)) {
-        LOG.debug("Attempted to unassign region " +
+        debugLog(region, "Attempted to unassign region " +
           region.getRegionNameAsString() + " but it is not " +
           "currently assigned anywhere");
         return;
@@ -1220,12 +1229,12 @@ public class AssignmentManager extends Z
         state = new RegionState(region, RegionState.State.PENDING_CLOSE);
         regionsInTransition.put(encodedName, state);
       } else if (force && state.isPendingClose()) {
-        LOG.debug("Attempting to unassign region " +
+        debugLog(region, "Attempting to unassign region " +
             region.getRegionNameAsString() + " which is already pending close "
             + "but forcing an additional close");
         state.update(RegionState.State.PENDING_CLOSE);
       } else {
-        LOG.debug("Attempting to unassign region " +
+        debugLog(region, "Attempting to unassign region " +
           region.getRegionNameAsString() + " but it is " +
           "already in transition (" + state.getState() + ")");
         return;
@@ -1238,12 +1247,12 @@ public class AssignmentManager extends Z
     }
     try {
       if (serverManager.sendRegionClose(server, state.getRegion())) {
-        LOG.debug("Sent CLOSE to " + server + " for region " +
+        debugLog(region, "Sent CLOSE to " + server + " for region " +
           region.getRegionNameAsString());
         return;
       }
       // This never happens. Currently regionserver close always return true.
-      LOG.debug("Server " + server + " region CLOSE RPC returned false for " +
+      LOG.warn("Server " + server + " region CLOSE RPC returned false for " +
         region.getEncodedName());
     } catch (NotServingRegionException nsre) {
       LOG.info("Server " + server + " returned " + nsre + " for " +

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/OpenedRegionHandler.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/OpenedRegionHandler.java?rev=1163419&r1=1163418&r2=1163419&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/OpenedRegionHandler.java
(original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/handler/OpenedRegionHandler.java
Tue Aug 30 21:51:34 2011
@@ -81,7 +81,7 @@ public class OpenedRegionHandler extends
 
   @Override
   public void process() {
-    LOG.debug("Handling OPENED event for " + this.regionInfo.getEncodedName() +
+    debugLog(regionInfo, "Handling OPENED event for " + this.regionInfo.getEncodedName()
+
       "; deleting unassigned node");
     // Remove region from in-memory transition and unassigned node from ZK
     try {
@@ -101,12 +101,21 @@ public class OpenedRegionHandler extends
     }
     if (this.assignmentManager.getZKTable().isDisablingOrDisabledTable(
         regionInfo.getTableDesc().getNameAsString())) {
-      LOG.debug("Opened region " + regionInfo.getRegionNameAsString() + " but "
+      debugLog(regionInfo,
+          "Opened region " + regionInfo.getRegionNameAsString() + " but "
           + "this table is disabled, triggering close of region");
       assignmentManager.unassign(regionInfo);
     } else {
-      LOG.debug("Opened region " + regionInfo.getRegionNameAsString() +
+      debugLog(regionInfo, "Opened region " + regionInfo.getRegionNameAsString() +
           " on " + serverInfo.getServerName());
     }
   }
+
+  private void debugLog(HRegionInfo region, String string) {
+    if (region.isMetaTable() || region.isRootRegion()) {
+      LOG.info(string);
+    } else {
+      LOG.debug(string);
+    }
+  }
 }



Mime
View raw message