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

Set files in thread safe manner in HiveSequenceFileInputFormat

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 4.1.0
    • HiveServer2
    • Security Level: Public (Viewable by anyone)

    Description

      When running Hive load tests, we observed Beeline can fetch wrong query result which is from another one running at same time. We ruled out Load Balancing issue, because it happened to a single HiveServer2. And we found this issue only happens when hive.query.result.cached.enabled is false.

      All test queries are in the same format as below:

      select concat('total record (test_$PID)=',count(*)) as count_record from t1t
      

      We randomized the query by replacing the $PID with the Beeline PID and the test driver ran 10 Beeline concurrently. The table t1t is static and has a few rows. So now the test driver can check if the query result is equal to: total record (test_recon_mock_$PID)=2

      When query result cache is disabled, we can see randomly query got a wrong result, and can always reproduced. For example, below two queries were running in parallel:

      queryId=hive_20240701103742_ff1adb2d-e9eb-448d-990e-00ab371e9db6): select concat('total record (test_21535)=',count(*)) as count_record from t1t
      
      queryId=hive_20240701103742_9bdfff92-89e1-4bcd-88ea-bf73ba5fd93d): select concat('total record (test_21566)=',count(*)) as count_record from t1t
      

      While the second query is supposed to get below result:
      total record (test_21566)=2

      But actually Beeline got below result:
      total record (test_21535)=2

      There is no error in the HS2 log.

      Attachments

        Issue Links

          Activity

            People

              sbadhya Sourabh Badhya
              ximz Xiaomin Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: