tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jihoon...@apache.org
Subject tajo git commit: TAJO-1731: With a task failure, query processing is hanged after first retry.
Date Fri, 31 Jul 2015 04:55:33 GMT
Repository: tajo
Updated Branches:
  refs/heads/master d80c32b28 -> bf8731921


TAJO-1731: With a task failure, query processing is hanged after first retry.

Closes #669


Project: http://git-wip-us.apache.org/repos/asf/tajo/repo
Commit: http://git-wip-us.apache.org/repos/asf/tajo/commit/bf873192
Tree: http://git-wip-us.apache.org/repos/asf/tajo/tree/bf873192
Diff: http://git-wip-us.apache.org/repos/asf/tajo/diff/bf873192

Branch: refs/heads/master
Commit: bf8731921679bfd9a653927c900c400f334d801c
Parents: d80c32b
Author: Jihoon Son <jihoonson@apache.org>
Authored: Fri Jul 31 13:55:12 2015 +0900
Committer: Jihoon Son <jihoonson@apache.org>
Committed: Fri Jul 31 13:55:12 2015 +0900

----------------------------------------------------------------------
 CHANGES                                                     | 3 +++
 .../org/apache/tajo/querymaster/DefaultTaskScheduler.java   | 9 +++++----
 .../src/main/java/org/apache/tajo/worker/TaskManager.java   | 1 -
 3 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/bf873192/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 4388414..4859a52 100644
--- a/CHANGES
+++ b/CHANGES
@@ -203,6 +203,9 @@ Release 0.11.0 - unreleased
 
   BUG FIXES
 
+    TAJO-1731: With a task failure, query processing is hanged after first retry. 
+    (jihoon)
+
     TAJO-1608: Fix test failure in index_support branch. (jihoon)
 
     TAJO-1594: Catalog schema is invalid for some databases. (jihoon)

http://git-wip-us.apache.org/repos/asf/tajo/blob/bf873192/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 32e4219..52f66ef 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
@@ -164,13 +164,14 @@ public class DefaultTaskScheduler extends AbstractTaskScheduler {
 
   public void schedule() throws Exception{
     try {
-      if (remainingScheduledObjectNum() == 0) {
+      final int incompleteTaskNum = stage.getTotalScheduledObjectsCount() - stage.getSucceededObjectCount();
+      if (incompleteTaskNum == 0) {
         // all task is done, wait for stopping message
         synchronized (schedulingThread) {
           schedulingThread.wait(500);
         }
       } else {
-        LinkedList<TaskRequestEvent> taskRequests = createTaskRequest();
+        LinkedList<TaskRequestEvent> taskRequests = createTaskRequest(incompleteTaskNum);
 
         if (taskRequests.size() == 0) {
           synchronized (schedulingThread) {
@@ -274,12 +275,12 @@ public class DefaultTaskScheduler extends AbstractTaskScheduler {
   }
 
 
-  protected LinkedList<TaskRequestEvent> createTaskRequest() throws Exception {
+  protected LinkedList<TaskRequestEvent> createTaskRequest(final int incompleteTaskNum)
throws Exception {
     LinkedList<TaskRequestEvent> taskRequestEvents = new LinkedList<TaskRequestEvent>();
 
     //If scheduled tasks is long-term task, cluster resource can be the worst load balance.
     //This part is to throttle the maximum required container per request
-    int requestContainerNum = Math.min(remainingScheduledObjectNum(), maximumRequestContainer);
+    int requestContainerNum = Math.min(incompleteTaskNum, maximumRequestContainer);
     if (LOG.isDebugEnabled()) {
       LOG.debug("Try to schedule task resources: " + requestContainerNum);
     }

http://git-wip-us.apache.org/repos/asf/tajo/blob/bf873192/tajo-core/src/main/java/org/apache/tajo/worker/TaskManager.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/worker/TaskManager.java b/tajo-core/src/main/java/org/apache/tajo/worker/TaskManager.java
index f518fd3..42db852 100644
--- a/tajo-core/src/main/java/org/apache/tajo/worker/TaskManager.java
+++ b/tajo-core/src/main/java/org/apache/tajo/worker/TaskManager.java
@@ -84,7 +84,6 @@ public class TaskManager extends AbstractService implements EventHandler<TaskMan
     for(ExecutionBlockContext context: executionBlockContextMap.values()) {
       context.stop();
     }
-    executionBlockContextMap.clear();
     super.serviceStop();
   }
 


Mime
View raw message