Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-14192

False positive error due to thrift

    XMLWordPrintableJSON

Details

    Description

      Given Thrift definition like this

      struct LockComponent {
          1: required LockType type,
          2: required LockLevel level,
          3: required string dbname,
          4: optional string tablename,
          5: optional string partitionname,
          6: optional DataOperationType operationType = DataOperationType.UNSET,
          7: optional bool isAcid = false
      }
      

      The generated LockComponent has

        public LockComponent() {
          this.operationType = org.apache.hadoop.hive.metastore.api.DataOperationType.UNSET;
      
          this.isAcid = false;
      
        }
        public boolean isSetOperationType() {
          return this.operationType != null;
        }
        public boolean isSetIsAcid() {
          return EncodingUtils.testBit(__isset_bitfield, __ISACID_ISSET_ID);
        }
      

      So bottom line is even if LockComponent is created by old version of the client which doesn't have operationType filed, isSetOperationType() will still return true on the server.

      This causes a false positive exception in TxnHandler.enqueueLockWithRetry() during Rolling Upgrade scenarios.

      Attachments

        1. HIVE-14192.patch
          2 kB
          Eugene Koifman
        2. HIVE-14192.2.patch
          2 kB
          Eugene Koifman

        Activity

          People

            ekoifman Eugene Koifman
            ekoifman Eugene Koifman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: