Repository: tajo Updated Branches: refs/heads/master 7d97284a9 -> a6334e989
TAJO-1851: Can not release a different rack task. Closes #760 Project: http://git-wip-us.apache.org/repos/asf/tajo/repo Commit: http://git-wip-us.apache.org/repos/asf/tajo/commit/a6334e98 Tree: http://git-wip-us.apache.org/repos/asf/tajo/tree/a6334e98 Diff: http://git-wip-us.apache.org/repos/asf/tajo/diff/a6334e98 Branch: refs/heads/master Commit: a6334e989e43f9aae5b8c65428c99249d2f77a1d Parents: 7d97284 Author: Jinho Kim <[email protected]> Authored: Wed Sep 16 12:38:48 2015 +0900 Committer: Jinho Kim <[email protected]> Committed: Wed Sep 16 12:38:48 2015 +0900 ---------------------------------------------------------------------- CHANGES | 2 ++ .../org/apache/tajo/querymaster/DefaultTaskScheduler.java | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tajo/blob/a6334e98/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index 5603c34..521ab20 100644 --- a/CHANGES +++ b/CHANGES @@ -266,6 +266,8 @@ Release 0.11.0 - unreleased BUG FIXES + TAJO-1851: Can not release a different rack task. (jinho) + TAJO-1830: Fix race condition in HdfsServiceTracker. (jinho) TAJO-1727: Avoid to create external table using TableSpace. (jaehwa) http://git-wip-us.apache.org/repos/asf/tajo/blob/a6334e98/tajo-core/src/main/java/org/apache/tajo/querymaster/DefaultTaskScheduler.java ---------------------------------------------------------------------- diff --git a/tajo-core/src/main/java/org/apache/tajo/querymaster/DefaultTaskScheduler.java b/tajo-core/src/main/java/org/apache/tajo/querymaster/DefaultTaskScheduler.java index d380295..b65b5a9 100644 --- a/tajo-core/src/main/java/org/apache/tajo/querymaster/DefaultTaskScheduler.java +++ b/tajo-core/src/main/java/org/apache/tajo/querymaster/DefaultTaskScheduler.java @@ -818,7 +818,7 @@ public class DefaultTaskScheduler extends AbstractTaskScheduler { int nodes = context.getMasterContext().getWorkerMap().size(); //this part is to control the assignment of tail and remote task balancing per node int tailLimit = 1; - if (remainingScheduledObjectNum() > 0) { + if (remainingScheduledObjectNum() > 0 && nodes > 0) { tailLimit = Math.max(remainingScheduledObjectNum() / nodes, 1); } @@ -835,9 +835,6 @@ public class DefaultTaskScheduler extends AbstractTaskScheduler { // rack-local allocation ////////////////////////////////////////////////////////////////////// attemptId = allocateRackTask(host); - if (attemptId != null && hostVolumeMapping != null) { - hostVolumeMapping.lastAssignedVolumeId.put(attemptId, HostVolumeMapping.REMOTE); - } ////////////////////////////////////////////////////////////////////// // random node allocation @@ -848,6 +845,10 @@ public class DefaultTaskScheduler extends AbstractTaskScheduler { leafTasks.remove(attemptId); } } + + if (attemptId != null && hostVolumeMapping != null) { + hostVolumeMapping.lastAssignedVolumeId.put(attemptId, HostVolumeMapping.REMOTE); + } rackAssign++; } else { localAssign++;
