HBASE-5103 Fix improper master znode deserialization (Jonathan Hsieh)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1225622 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2011-12-29 19:08:38 +00:00
parent 8f101720a2
commit 315c91901f
3 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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:");