[
https://issues.apache.org/jira/browse/HIVE-24201?focusedWorklogId=567145&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-567145
]
ASF GitHub Bot logged work on HIVE-24201:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 16/Mar/21 17:52
Start Date: 16/Mar/21 17:52
Worklog Time Spent: 10m
Work Description: guptanikhil007 commented on a change in pull request
#2065:
URL: https://github.com/apache/hive/pull/2065#discussion_r594076379
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/tez/WorkloadManager.java
##########
@@ -657,6 +673,30 @@ private void processCurrentEvents(EventState e,
WmThreadSyncWork syncWork) throw
}
e.toReuse.clear();
+ // For pools which have queued requests, move the "delayed moves" now
Review comment:
Comment meaning is not clear
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/tez/WorkloadManager.java
##########
@@ -794,17 +834,18 @@ private void handleMoveSessionOnMasterThread(final
MoveSession moveSession,
final WmThreadSyncWork syncWork,
final HashSet<String> poolsToRedistribute,
final Map<WmTezSession, GetRequest> toReuse,
- final Map<WmTezSession, WmEvent> recordMoveEvents) {
+ final Map<WmTezSession, WmEvent> recordMoveEvents,
+ final boolean moveImmediately) {
Review comment:
nit: indentation fix
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/tez/WorkloadManager.java
##########
@@ -816,18 +857,36 @@ private void handleMoveSessionOnMasterThread(final
MoveSession moveSession,
LOG.error("Failed to move session: {}. Session is not added to
destination.", moveSession);
}
} else {
- WmTezSession session = moveSession.srcSession;
- KillQueryContext killQueryContext = new KillQueryContext(session,
"Destination pool " + destPoolName +
- " is full. Killing query.");
- resetAndQueueKill(syncWork.toKillQuery, killQueryContext, toReuse);
+ LOG.error("Failed to move session: {}. Session is not removed from its
pool.", moveSession);
}
} else {
- LOG.error("Failed to move session: {}. Session is not removed from its
pool.", moveSession);
+ // If delayed move is set to true, don't kill the query. Let the query
run in source pool
+ // add the session to the source pool's delayed move sessions so that
the session can be moved
+ // later when there is a new request on the source pool.
+ if(HiveConf.getBoolVar(conf, ConfVars.HIVE_SERVER2_WM_DELAYED_MOVE) &&
!moveImmediately) {
+ LOG.info("Move: {} is a delayed move.Since destination pool {} is
full, running in source pool "
+ + "as long as possible.", moveSession, destPoolName);
+ String srcPoolName = moveSession.srcSession.getPoolName();
+ if (srcPoolName != null) {
+ PoolState srcPool = pools.get(srcPoolName);
+ if (srcPool != null) {
+ if (srcPool.delayedMoveSessionsSet.add(moveSession)) {
+ srcPool.delayedMoveSessionsQueue.addLast(moveSession);
Review comment:
We can try using TreeSet instead of a queue and a HashSet
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/tez/WorkloadManager.java
##########
@@ -657,6 +673,30 @@ private void processCurrentEvents(EventState e,
WmThreadSyncWork syncWork) throw
}
e.toReuse.clear();
+ // For pools which have queued requests, move the "delayed moves" now
Review comment:
Put the code behind the config
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 567145)
Time Spent: 0.5h (was: 20m)
> WorkloadManager kills query being moved to different pool if destination pool
> does not have enough sessions
> -----------------------------------------------------------------------------------------------------------
>
> Key: HIVE-24201
> URL: https://issues.apache.org/jira/browse/HIVE-24201
> Project: Hive
> Issue Type: Improvement
> Components: HiveServer2, llap
> Affects Versions: 4.0.0
> Reporter: Adesh Kumar Rao
> Assignee: Pritha Dawn
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> To reproduce, create a resource plan with move trigger, like below:
> {code:java}
> +----------------------------------------------------+
> | line |
> +----------------------------------------------------+
> | experiment[status=DISABLED,parallelism=null,defaultPool=default] |
> | + default[allocFraction=0.888,schedulingPolicy=null,parallelism=1] |
> | | mapped for default |
> | + pool2[allocFraction=0.1,schedulingPolicy=fair,parallelism=1] |
> | | trigger t1: if (ELAPSED_TIME > 20) { MOVE TO pool1 } |
> | | mapped for users: abcd |
> | + pool1[allocFraction=0.012,schedulingPolicy=null,parallelism=1] |
> | | mapped for users: efgh |
>
> {code}
> Now, run two queries in pool1 and pool2 using different users. The query
> running in pool2 will tried to move to pool1 and it will get killed because
> pool1 will not have session to handle the query.
> Currently, the Workload management move trigger kills the query being moved
> to a different pool if destination pool does not have enough capacity. We
> could have a "delayed move" configuration which lets the query run in the
> source pool as long as possible, if the destination pool is full. It will
> attempt the move to destination pool only when there is claim upon the source
> pool. If the destination pool is not full, delayed move behaves as normal
> move i.e. the move will happen immediately.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)