Sahil Takiar has uploaded this change for review. ( http://gerrit.cloudera.org:8080/16148
Change subject: IMPALA-9855, IMPALA-9854: Fix query retry TSAN errors ...................................................................... IMPALA-9855, IMPALA-9854: Fix query retry TSAN errors Fixed two warnings reported by TSAN. One of them is a data race on exec_request_. The other is a lock-inversion warning. The data race on exec_request_ is present because the same exec_request_ is used for the original and retried query. The issue is when a query is retried it needs to set a new query id in the exec_request_, so retrying a query requires mutating the exec_request_. However, even after a query is retried the exec_request_ can still be accessed for the original query. Specifically, an exec status report from a fragment can still be propagated even after the query has been cancelled (e.g. ControlService::ReportExecStatus can still access the original exec_request_). IMPALA-9199 attempted to be smart about re-using the TExecRequest for retried queries, but given the race conditions it seems like a pre-mature optimization. We can re-visit IMPALA-9502 if we think it actually makes a perf difference. The lock-inversion warning is between the sharded locks in ShardedQueryMap (specifically the QueryDriverMap query_driver_map_ in ImpalaServer) and QueryDriver::client_request_state_lock_. The correct lock ordering is to acquire the sharded lock in query_driver_map_ and then to acquire the client_request_state_lock_. QueryDriver::RetryQueryFromThread reversed the ordering. I wasn't able to actually produce a deadlock, but fixing the ordering issue was trivial. Testing: * Ran core tests * Manually checked that the query retry tests are TSAN clean Change-Id: Ife2c7492524647bfd8f053dacbda4c553a64eb61 --- M be/src/runtime/query-driver.cc M be/src/runtime/query-driver.h 2 files changed, 17 insertions(+), 4 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/48/16148/1 -- To view, visit http://gerrit.cloudera.org:8080/16148 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ife2c7492524647bfd8f053dacbda4c553a64eb61 Gerrit-Change-Number: 16148 Gerrit-PatchSet: 1 Gerrit-Owner: Sahil Takiar <[email protected]>
