You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by jx...@apache.org on 2013/06/22 17:42:50 UTC
svn commit: r1495747 - in /hbase/branches/0.95:
hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java
hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/MetaServerShutdownHandler.java
Author: jxiang
Date: Sat Jun 22 15:42:50 2013
New Revision: 1495747
URL: http://svn.apache.org/r1495747
Log:
HBASE-8750 MetaServerShutdownHandler stucks if .META. assignment fails in previous attempt
Modified:
hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java
hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/MetaServerShutdownHandler.java
Modified: hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java?rev=1495747&r1=1495746&r2=1495747&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java (original)
+++ hbase/branches/0.95/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java Sat Jun 22 15:42:50 2013
@@ -235,6 +235,13 @@ public class CatalogTracker {
}
/**
+ * Checks whether meta regionserver znode has some non null data.
+ * @return true if data is not null, false otherwise.
+ */
+ public boolean isMetaLocationAvailable() {
+ return this.metaRegionTracker.isLocationAvailable();
+ }
+ /**
* Gets the current location for <code>.META.</code> if available and waits
* for up to the specified timeout if not immediately available. Returns null
* if the timeout elapses before root is available.
Modified: hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/MetaServerShutdownHandler.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/MetaServerShutdownHandler.java?rev=1495747&r1=1495746&r2=1495747&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/MetaServerShutdownHandler.java (original)
+++ hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/MetaServerShutdownHandler.java Sat Jun 22 15:42:50 2013
@@ -76,6 +76,11 @@ public class MetaServerShutdownHandler e
LOG.info("Server " + serverName + " was carrying META. Trying to assign.");
am.regionOffline(HRegionInfo.FIRST_META_REGIONINFO);
verifyAndAssignMetaWithRetries();
+ } else if (!this.services.getCatalogTracker().isMetaLocationAvailable()) {
+ // the meta location as per master is null. This could happen in case when meta assignment
+ // in previous run failed, while meta znode has been updated to null. We should try to
+ // assign the meta again.
+ verifyAndAssignMetaWithRetries();
} else {
LOG.info("META has been assigned to otherwhere, skip assigning.");
}