From f7880080ad81bec192b29a0441b3d3ecaf0e81d5 Mon Sep 17 00:00:00 2001 From: zhengchenyu Date: Thu, 31 Oct 2024 15:11:27 +0800 Subject: [PATCH] TEZ-4585: Fix counters for speculation --- .../src/main/java/org/apache/tez/dag/app/dag/impl/TaskImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()); } }