From 7871e633c68d54d1a7b925d000771a5ce7517de9 Mon Sep 17 00:00:00 2001 From: Kashif Faraz Date: Mon, 11 Sep 2023 15:18:15 +0530 Subject: [PATCH] Fix bug in KillStalePendingSegments (#14961) --- .../server/coordinator/duty/KillStalePendingSegments.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server/src/main/java/org/apache/druid/server/coordinator/duty/KillStalePendingSegments.java b/server/src/main/java/org/apache/druid/server/coordinator/duty/KillStalePendingSegments.java index da730e20c0ba..ad07c3b31772 100644 --- a/server/src/main/java/org/apache/druid/server/coordinator/duty/KillStalePendingSegments.java +++ b/server/src/main/java/org/apache/druid/server/coordinator/duty/KillStalePendingSegments.java @@ -118,9 +118,7 @@ private DateTime getMinCreatedTimeToRetain() DateTime earliestActiveTaskStart = DateTimes.nowUtc(); DateTime latestCompletedTaskStart = null; for (TaskStatusPlus status : statuses) { - if (status.getStatusCode() == null) { - // Unknown status - } else if (status.getStatusCode().isComplete()) { + if (status.getStatusCode() != null && status.getStatusCode().isComplete()) { latestCompletedTaskStart = DateTimes.laterOf( latestCompletedTaskStart, status.getCreatedTime()