HBASE-6858 Fix the incorrect BADVERSION checking in the recoverable zookeeper
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1388699 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c462f1a835
commit
529807b0e5
|
@ -357,12 +357,9 @@ public class RecoverableZooKeeper {
|
||||||
try{
|
try{
|
||||||
Stat stat = new Stat();
|
Stat stat = new Stat();
|
||||||
byte[] revData = zk.getData(path, false, stat);
|
byte[] revData = zk.getData(path, false, stat);
|
||||||
int idLength = Bytes.toInt(revData, ID_LENGTH_SIZE);
|
int idLength = Bytes.toInt(revData, MAGIC_OFFSET);
|
||||||
int dataLength = revData.length-ID_LENGTH_SIZE-idLength;
|
if (Bytes.compareTo(revData, MAGIC_OFFSET + ID_OFFSET, idLength,
|
||||||
int dataOffset = ID_LENGTH_SIZE+idLength;
|
id, 0, id.length) == 0) {
|
||||||
|
|
||||||
if(Bytes.compareTo(revData, ID_LENGTH_SIZE, id.length,
|
|
||||||
revData, dataOffset, dataLength) == 0) {
|
|
||||||
// the bad version is caused by previous successful setData
|
// the bad version is caused by previous successful setData
|
||||||
return stat;
|
return stat;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue