[ 
https://issues.apache.org/jira/browse/IMPALA-12602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17833469#comment-17833469
 ] 

ASF subversion and git services commented on IMPALA-12602:
----------------------------------------------------------

Commit f05eac647647b5e03c3aafc35f785c73d07e2658 in impala's branch 
refs/heads/master from Michael Smith
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=f05eac647 ]

IMPALA-12602: Unregister queries on idle timeout

Queries cancelled due to idle_query_timeout/QUERY_TIMEOUT_S are now also
Unregistered to free any remaining memory, as you cannot fetch results
from a cancelled query.

Adds a new structure - idle_query_statuses_ - to retain Status messages
for queries closed this way so that we can continue to return a clear
error message if the client returns and requests query status or
attempts to fetch results. This structure must be global because HS2
server can only identify a session ID from a query handle, and the query
handle no longer exists. SessionState tracks queries added to
idle_query_statuses_ so they can be cleared when the session is closed.

Also ensures MarkInactive is called in ClientRequestState when Wait()
completes. Previously WaitInternal would only MarkInactive on success,
leaving any failed requests in an active state until explicitly closed
or the session ended.

The beeswax get_log RPC will not return the preserved error message or
any warnings for these queries. It's also possible the summary and
profile are rotated out of query log as the query is no longer inflight.
This is an acceptable outcome as a client will likely not look for a
log/summary/profile after it times out.

Testing:
- updates test_query_expiration to verify number of waiting queries is
  only non-zero for queries cancelled by EXEC_TIME_LIMIT_S and not yet
  closed as an idle query
- modified test_retry_query_timeout to use exec_time_limit_s because
  queries closed by idle_timeout_s don't work with get_exec_summary

Change-Id: Iacfc285ed3587892c7ec6f7df3b5f71c9e41baf0
Reviewed-on: http://gerrit.cloudera.org:8080/21074
Reviewed-by: Michael Smith <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>


> Timed out queries are not unregistered until session is closed
> --------------------------------------------------------------
>
>                 Key: IMPALA-12602
>                 URL: https://issues.apache.org/jira/browse/IMPALA-12602
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Backend
>    Affects Versions: Impala 4.0.0
>            Reporter: Michael Smith
>            Assignee: Michael Smith
>            Priority: Major
>
> When Impala triggers 
> [ExpireQuery|https://github.com/apache/impala/blob/master/be/src/service/impala-server.cc#L3062]
>  - via reaching resource limits, EXEC_TIME_LIMIT_S, or 
> idle_query_timeout/QUERY_TIMEOUT_S - it cancels the query, but does not 
> unregister it.  It will only be unregistered when the session is closed. That 
> means Impala continues to report the query as inflight until the session 
> ends; in some multi-user scenarios, a session may be in-use for hours or days 
> and keep these queries active for the same.
> This can be confusing for admins, who see a list of queries waiting to be 
> closed - some of which have been cancelled by EXEC_TIME_LIMIT_S (for example) 
> - and are unclear why they're still there.
> One thing we could do is modify the behavior of {{{}idle_query_timeout{}}}. 
> {{idle_session_timeout}} causes the session to close. Queries that time out 
> due to {{idle_query_timeout}} should similarly be abandoned and unregistered. 
> Any other query that expires should still be checked for 
> {{idle_query_timeout}} and unregistered once it hits that timeout (as it is 
> clearly an idle query).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to