diff --git a/internal/datanode/syncmgr/sync_manager.go b/internal/datanode/syncmgr/sync_manager.go index 1443f50dfbda2..875157054fed8 100644 --- a/internal/datanode/syncmgr/sync_manager.go +++ b/internal/datanode/syncmgr/sync_manager.go @@ -119,6 +119,10 @@ func (mgr *syncManager) safeSubmitTask(task Task, callbacks ...func(error) error func (mgr *syncManager) submit(key int64, task Task, callbacks ...func(error) error) *conc.Future[struct{}] { handler := func(err error) error { + taskKey := fmt.Sprintf("%d-%d", task.SegmentID(), task.Checkpoint().GetTimestamp()) + defer func() { + mgr.tasks.Remove(taskKey) + }() if err == nil { return nil }