Dawn2111 commented on a change in pull request #2065:
URL: https://github.com/apache/hive/pull/2065#discussion_r599773480



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/tez/WorkloadManager.java
##########
@@ -794,17 +828,17 @@ 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) {
     String destPoolName = moveSession.destPool;
-    LOG.info("Handling move session event: {}", moveSession);
+    LOG.info("Handling move session event: {}, move immediately: {}", 
moveSession, moveImmediately);
     if (validMove(moveSession.srcSession, destPoolName)) {
       WmEvent moveEvent = new WmEvent(WmEvent.EventType.MOVE);
-      // remove from src pool
-      RemoveSessionResult rr = checkAndRemoveSessionFromItsPool(
+      // check if there is capacity in dest pool
+      if (capacityAvailable(destPoolName)) {

Review comment:
       Thanks for catch! This introduced a bug as the session wasn't being 
removed from the source pool when the query was killed. However, cannot do 
exactly as suggested above as we don't want to remove the session from the 
source pool if delayedMove is true and dest pool is maxed out. Changed it like 
this :
   Left the flow as it is if delayedMove is false. Added a block for the case 
when delayed move is true and dest. pool is maxed out. This adds the session to 
the source pool's delayedMoveSessions.




-- 
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]



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

Reply via email to