Michael Smith has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/24702 )

Change subject: IMPALA-15115: Fix race condition in GetOperationStatus with 
query retries
......................................................................

IMPALA-15115: Fix race condition in GetOperationStatus with query retries

GetOperationStatus() (and get_state() for beeswax) gets the
active query handle, waits for execution to complete, then
returns the status for that query handle. While this is
happening, the query could hit an error and get retried.
In that case, GetOperationStatus is still looking at the old
query handle that failed. It would return the failure even
though there is a new query handle for the retry.

Long polling waits for an extended time for execution to
complete, so it deterministically hits this issue.

This changes the logic so that it detects a retry, looks up the
new active handle, and returns the status from the new handle.
This applies to both HS2 and Beeswax.

Testing:
 - Added tests to test_query_retries.py with long polling for both
   HS2 and Beeswax

Change-Id: I9934a797650eec57b8280e6a6d2ef252dac00c69
Reviewed-on: http://gerrit.cloudera.org:8080/24702
Reviewed-by: Csaba Ringhofer <[email protected]>
Tested-by: Michael Smith <[email protected]>
---
M be/src/service/impala-beeswax-server.cc
M be/src/service/impala-hs2-server.cc
M be/src/service/impala-server.h
M tests/custom_cluster/test_query_retries.py
4 files changed, 174 insertions(+), 22 deletions(-)

Approvals:
  Csaba Ringhofer: Looks good to me, approved
  Michael Smith: Verified

--
To view, visit http://gerrit.cloudera.org:8080/24702
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I9934a797650eec57b8280e6a6d2ef252dac00c69
Gerrit-Change-Number: 24702
Gerrit-PatchSet: 5
Gerrit-Owner: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Csaba Ringhofer <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>

Reply via email to