diff --git a/CHANGES.txt b/CHANGES.txt index 908da71cdc8..e24294d8135 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -462,6 +462,7 @@ Release 0.92.0 - Unreleased lots of regions HBASE-5077 SplitLogWorker fails to let go of a task, kills the RS HBASE-5096 Replication does not handle deletes correctly. (Lars H) + HBASE-5103 Fix improper master znode deserialization (Jonathan Hsieh) TESTS HBASE-4450 test for number of blocks read: to serve as baseline for expected diff --git a/src/main/java/org/apache/hadoop/hbase/master/ActiveMasterManager.java b/src/main/java/org/apache/hadoop/hbase/master/ActiveMasterManager.java index c46d5b29be6..2f60b23165a 100644 --- a/src/main/java/org/apache/hadoop/hbase/master/ActiveMasterManager.java +++ b/src/main/java/org/apache/hadoop/hbase/master/ActiveMasterManager.java @@ -204,7 +204,7 @@ class ActiveMasterManager extends ZooKeeperListener { byte [] bytes = ZKUtil.getDataAndWatch(watcher, watcher.masterAddressZNode); // TODO: redo this to make it atomic (only added for tests) - ServerName master = new ServerName(Bytes.toString(bytes)); + ServerName master = ServerName.parseVersionedServerName(bytes); if (master != null && master.equals(this.sn)) { ZKUtil.deleteNode(watcher, watcher.masterAddressZNode); } diff --git a/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java b/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java index 157bffaf2a6..111f76e5ec1 100644 --- a/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java +++ b/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java @@ -35,6 +35,7 @@ import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.EmptyWatcher; import org.apache.hadoop.hbase.HConstants; +import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.executor.RegionTransitionData; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Threads; @@ -1034,7 +1035,7 @@ public class ZKUtil { try { sb.append("HBase is rooted at ").append(zkw.baseZNode); sb.append("\nMaster address: ").append( - Bytes.toStringBinary(getData(zkw, zkw.masterAddressZNode))); + ServerName.parseVersionedServerName(getData(zkw, zkw.masterAddressZNode))); sb.append("\nRegion server holding ROOT: ").append( Bytes.toStringBinary(getData(zkw, zkw.rootServerZNode))); sb.append("\nRegion servers:");