From dff7ec7bb297110a7e4b29eccb136df13670a53a Mon Sep 17 00:00:00 2001 From: XuanYang-cn Date: Fri, 14 Jun 2024 10:45:58 +0800 Subject: [PATCH] enhance: Donot mark compaction tasks to be timeouted (#33833) Signed-off-by: yangxuan --- internal/datacoord/compaction.go | 5 ++--- internal/datacoord/compaction_test.go | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/datacoord/compaction.go b/internal/datacoord/compaction.go index dff05b00aa..ee6153281b 100644 --- a/internal/datacoord/compaction.go +++ b/internal/datacoord/compaction.go @@ -574,13 +574,13 @@ func (c *compactionPlanHandler) updateCompaction(ts Timestamp) error { } case commonpb.CompactionState_Executing: + // If it's still executing, DC will continue to wait, donot set tasks to be timeout here if c.isTimeout(ts, task.plan.GetStartTime(), task.plan.GetTimeoutInSeconds()) { log.Warn("compaction timeout", zap.Int32("timeout in seconds", task.plan.GetTimeoutInSeconds()), zap.Uint64("startTime", task.plan.GetStartTime()), zap.Uint64("now", ts), ) - c.plans[planID] = c.plans[planID].shadowClone(setState(timeout), endSpan()) } } } else { @@ -592,8 +592,7 @@ func (c *compactionPlanHandler) updateCompaction(ts Timestamp) error { } } - // Timeout tasks will be timeout and failed in DataNode - // need to wait for DataNode reporting failure and clean the status. + // Notify failed tasks is marked to be timeout, and needs to clean status here for _, task := range timeoutTasks { log := log.With( zap.Int64("planID", task.plan.PlanID), diff --git a/internal/datacoord/compaction_test.go b/internal/datacoord/compaction_test.go index 00e69e3376..1ae76ee518 100644 --- a/internal/datacoord/compaction_test.go +++ b/internal/datacoord/compaction_test.go @@ -745,7 +745,7 @@ func (s *CompactionPlanHandlerSuite) TestUpdateCompaction() { s.NoError(err) task := handler.plans[1] - s.Equal(timeout, task.state) + s.Equal(executing, task.state) task = handler.plans[2] s.Equal(executing, task.state)