hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ekoif...@apache.org
Subject [1/2] hive git commit: HIVE-14192 False positive error due to thrift (Eugene Koifman, reviewed by Wei Zheng)
Date Sat, 09 Jul 2016 03:09:09 GMT
Repository: hive
Updated Branches:
  refs/heads/branch-1 67fecf3f7 -> 8f24aa1d0


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/ed7cce05
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/ed7cce05
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/ed7cce05

Branch: refs/heads/branch-1
Commit: ed7cce05c1632b061428df2eade50bcd447cfd5c
Parents: 67fecf3
Author: Eugene Koifman <ekoifman@hortonworks.com>
Authored: Fri Jul 8 19:24:41 2016 -0700
Committer: Eugene Koifman <ekoifman@hortonworks.com>
Committed: Fri Jul 8 19:24:41 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/ed7cce05/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 2940ab8..16d45ed 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
@@ -946,8 +946,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());
           }


Mime
View raw message