hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mbau...@apache.org
Subject svn commit: r1390818 - /hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java
Date Thu, 27 Sep 2012 03:07:16 GMT
Author: mbautin
Date: Thu Sep 27 03:07:16 2012
New Revision: 1390818

URL: http://svn.apache.org/viewvc?rev=1390818&view=rev
Log:
[HBASE-6858] Fix the incorrect BADVERSION checking in the recoverable zookeeper

Author: liyintang

Summary: There is a bug in the recoverable zookeeper when handling BADVERSION exception for
setData(). It shall compare the ID payload of the data in zk with its own identifier.

Test Plan: Running all the unit tests

Reviewers: kannan, kranganathan

Reviewed By: kannan

CC: hbase-eng@

Differential Revision: https://phabricator.fb.com/D581409

Modified:
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java?rev=1390818&r1=1390817&r2=1390818&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java
(original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java
Thu Sep 27 03:07:16 2012
@@ -370,12 +370,7 @@ public class RecoverableZooKeeper {
             try{
               Stat stat = new Stat();
               byte[] revData = zk.getData(path, false, stat);
-              int idLength = Bytes.toInt(revData, ID_OFFSET);
-              int dataLength = revData.length-ID_OFFSET-idLength;
-              int dataOffset = ID_OFFSET+idLength;
-
-              if(Bytes.compareTo(revData, ID_OFFSET, id.length,
-                  revData, dataOffset, dataLength) == 0) {
+              if (Bytes.compareTo(revData, newData) == 0) {
                 // the bad version is caused by previous successful setData
                 return stat;
               }



Mime
View raw message