New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Improvement](executor)Add queue columns for active_queries #32259
Conversation
Thank you for your contribution to Apache Doris. |
run buildall |
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
1 similar comment
clang-tidy review says "All clean, LGTM! 👍" |
TPC-H: Total hot run time: 38312 ms
|
TeamCity be ut coverage result: |
LOG.error("query (id=" + DebugUtil.printId(queryId) + ") " + queueToken.getOfferResultDetail()); | ||
queryQueue.returnToken(queueToken); | ||
throw new UserException(queueToken.getOfferResultDetail()); | ||
long queueStartTime = System.currentTimeMillis(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这么改不好,容易锁死。
直接把queue start time和queue end time 放到queue token 里,然后token 本身是coordinator的一个属性就ok了。
当我们显示的时候,直接从token 里拿start time和end time 就可以了
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
@@ -105,6 +106,26 @@ public void registerQuery(TUniqueId queryId, QueryInfo info) throws UserExceptio | |||
} | |||
} | |||
|
|||
@Override | |||
public QueryInfo getQueryInfoByQueryId(TUniqueId queryId) throws UserException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both query start time and token are in coordinator, we could get these info directly from coordinator.
And QueryInfo contains a coordinator. So that we do not need these API any more.
@@ -574,6 +537,36 @@ private static TFetchSchemaTableDataResult queriesMetadataResult(TSchemaTableReq | |||
trow.addToColumnValue(new TCell().setStringVal("")); | |||
} | |||
trow.addToColumnValue(new TCell().setStringVal(selfNode)); | |||
|
|||
QueueToken queueToken = queryInfo.getQueueToken(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use token directly here.
Add related method in QueryInfo, for example getQueueStartTime, getQueueEndTime
and then QueryInfo could use coordinator to get these time.
@@ -295,6 +318,18 @@ public String getSql() { | |||
public long getStartExecTime() { | |||
return startExecTime; | |||
} | |||
|
|||
public void setQueueToken(QueueToken queueToken) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove setQueueToken and getQueueToken setStartExecTime
Get these info from coordinator directly.
TPC-H: Total hot run time: 38578 ms
|
TeamCity be ut coverage result: |
clang-tidy review says "All clean, LGTM! 👍" |
2 similar comments
clang-tidy review says "All clean, LGTM! 👍" |
clang-tidy review says "All clean, LGTM! 👍" |
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
1 similar comment
clang-tidy review says "All clean, LGTM! 👍" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
TPC-H: Total hot run time: 37997 ms
|
TeamCity be ut coverage result: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add QUEUE_START_TIME/QUEUE_END_TIME/QUERY_STATUS column for active_queries;