Repository: hive
Updated Branches:
  refs/heads/branch-2.1 6588b8402 -> cec61d945


HIVE-14192 False positive error due to thrift (Eugene Koifman, reviewed by Wei 
Zheng)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/c5a9b0cb
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/c5a9b0cb
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/c5a9b0cb

Branch: refs/heads/branch-2.1
Commit: c5a9b0cbc4dffc306d6f7189b63b4009d0fbeb35
Parents: 6588b84
Author: Eugene Koifman <ekoif...@hortonworks.com>
Authored: Fri Jul 8 18:32:44 2016 -0700
Committer: Eugene Koifman <ekoif...@hortonworks.com>
Committed: Fri Jul 8 18:32:44 2016 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hive/metastore/txn/TxnHandler.java    | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/c5a9b0cb/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
----------------------------------------------------------------------
diff --git 
a/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java 
b/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
index 119b08e..e4025ca 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
@@ -927,8 +927,13 @@ abstract class TxnHandler implements TxnStore, 
TxnStore.MutexAPI {
         List<String> rows = new ArrayList<>();
         long intLockId = 0;
         for (LockComponent lc : rqst.getComponent()) {
-          if(lc.isSetOperationType() && lc.getOperationType() == 
DataOperationType.UNSET) {
-            //old version of thrift client should have 
(lc.isSetOperationType() == false)
+          if(lc.isSetOperationType() && lc.getOperationType() == 
DataOperationType.UNSET &&
+            (conf.getBoolVar(HiveConf.ConfVars.HIVE_IN_TEST) || 
conf.getBoolVar(HiveConf.ConfVars.HIVE_IN_TEZ_TEST))) {
+            //old version of thrift client should have 
(lc.isSetOperationType() == false) but they do not
+            //If you add a default value to a variable, isSet() for that 
variable is true regardless of the where the
+            //message was created (for object variables.  It works correctly 
for boolean vars, e.g. LockComponent.isAcid).
+            //in test mode, upgrades are not tested, so client version and 
server version of thrift always matches so
+            //we see UNSET here it means something didn't set the appropriate 
value.
             throw new IllegalStateException("Bug: operationType=" + 
lc.getOperationType() + " for component "
               + lc + " agentInfo=" + rqst.getAgentInfo());
           }

Reply via email to