diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/TaskImpl.java b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/TaskImpl.java index 1a88673a0b..73856f0407 100644 --- a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/TaskImpl.java +++ b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/TaskImpl.java @@ -1036,7 +1036,6 @@ private static class RedundantScheduleTransition @Override public void transition(TaskImpl task, TaskEvent event) { LOG.info("Scheduling a redundant attempt for task " + task.taskId); - task.counters.findCounter(TaskCounter.NUM_SPECULATIONS).increment(1); TaskAttempt earliestUnfinishedAttempt = null; for (TaskAttempt ta : task.attempts.values()) { // find the oldest running attempt @@ -1063,6 +1062,7 @@ public void transition(TaskImpl task, TaskEvent event) { task.getTaskID(), task.commitAttempt); return; } + task.counters.findCounter(TaskCounter.NUM_SPECULATIONS).increment(1); task.addAndScheduleAttempt(earliestUnfinishedAttempt.getTaskAttemptID()); } }