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

Change subject: IMPALA-12493: Allow retry after failed cancel_query
......................................................................

IMPALA-12493: Allow retry after failed cancel_query

Previously if /cancel_query failed with "Query not yet running",
subsequent attempts to cancel the query would always fail and the query
would never be unregistered (so it would stay in "queries in flight" or
"waiting to be closed" until the coordinator was restarted) because the
QueryDriver thought the query was finalized. Check whether the query is
inflight before setting finalized_ to allow retries.

Cancelling a request can no longer fail, so checks for whether the query
is inflight are moved to the callers.

Two ClientRequestState::Finalize calls that previously passed
check_inflight=true no longer check inflight. Retried queries should
always reach inflight before they need to be finalized. They were added
in IMPALA-10413 and IMPALA-10414 with no explanation why check inflight
was needed - presumably it was done because earlier in the function the
retried query was marked inflight - and still pass their tests. Added
DCHECKs since the query should be inflight until closed.

Testing:
- adds a test that canceling a query in CREATED state fails but does not
  prevent canceling the query later
- adds a test that canceling a query that later fails results in that
  query completing rather than going to "waiting to be closed"

Change-Id: I6e2c8872e91a7ff078cedb13e0771bcfaae6ee24
Reviewed-on: http://gerrit.cloudera.org:8080/20584
Tested-by: Michael Smith <michael.sm...@cloudera.com>
Reviewed-by: Michael Smith <michael.sm...@cloudera.com>
Reviewed-by: Riza Suminto <riza.sumi...@cloudera.com>
---
M be/src/runtime/query-driver.cc
M be/src/runtime/query-driver.h
M be/src/service/client-request-state.cc
M be/src/service/client-request-state.h
M be/src/service/impala-server.cc
M fe/src/main/java/org/apache/impala/service/Frontend.java
M fe/src/main/java/org/apache/impala/util/DebugUtils.java
M tests/webserver/test_web_pages.py
8 files changed, 173 insertions(+), 50 deletions(-)

Approvals:
  Michael Smith: Looks good to me, but someone else must approve; Verified
  Riza Suminto: Looks good to me, approved

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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6e2c8872e91a7ff078cedb13e0771bcfaae6ee24
Gerrit-Change-Number: 20584
Gerrit-PatchSet: 7
Gerrit-Owner: Michael Smith <michael.sm...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Jason Fehr <jf...@cloudera.com>
Gerrit-Reviewer: Michael Smith <michael.sm...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <huangquanl...@gmail.com>
Gerrit-Reviewer: Riza Suminto <riza.sumi...@cloudera.com>

Reply via email to