Index: src/main/java/org/apache/hadoop/hbase/executor/RegionTransitionData.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/executor/RegionTransitionData.java (revision 1230294) +++ src/main/java/org/apache/hadoop/hbase/executor/RegionTransitionData.java (working copy) @@ -178,21 +178,32 @@ @Override public void readFields(DataInput in) throws IOException { - // the event type byte - eventType = EventType.values()[in.readShort()]; - // the timestamp - stamp = in.readLong(); - // the encoded name of the region being transitioned - regionName = Bytes.readByteArray(in); - // remaining fields are optional so prefixed with boolean - // the name of the regionserver sending the data - if (in.readBoolean()) { - byte [] versionedBytes = Bytes.readByteArray(in); - this.origin = ServerName.parseVersionedServerName(versionedBytes); - } - if (in.readBoolean()) { - this.payload = Bytes.readByteArray(in); - } + try{ + // the event type byte + eventType = EventType.values()[in.readShort()]; + // the timestamp + stamp = in.readLong(); + // the encoded name of the region being transitioned + regionName = Bytes.readByteArray(in); + // remaining fields are optional so prefixed with boolean + // the name of the regionserver sending the data + if (in.readBoolean()) { + byte [] versionedBytes = Bytes.readByteArray(in); + this.origin = ServerName.parseVersionedServerName(versionedBytes); + } + if (in.readBoolean()) { + this.payload = Bytes.readByteArray(in); + } + }catch(IOException ioe){ + if(regionName != null){ + throw new IOException("There could be a stale region-in-transition in ZK." + + " The bad region is " + Bytes.toString(regionName) + + ". Try deleting the region-in-transition using 'del /unassigned/" + + Bytes.toString(regionName) + "' command over a ZK connection (in zkCli.sh)", ioe); + }else{ + throw ioe; + } + } }