Skip to content

Commit

Permalink
fix: fix compaction task startTime is 0 (#34496)
Browse files Browse the repository at this point in the history
fix bug: #34497 #34498

---------

Signed-off-by: wayblink <anyang.wang@zilliz.com>
  • Loading branch information
wayblink committed Jul 9, 2024
1 parent 391d2aa commit 0c4d82c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 0 additions & 2 deletions internal/datacoord/compaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,13 @@ func (c *compactionPlanHandler) getCompactionTasksNumBySignalID(triggerID int64)
}
// if t.GetPlanID()
}
cnt += len(c.queueTasks)
c.mu.RUnlock()
c.executingMu.RLock()
for _, t := range c.executingTasks {
if t.GetTriggerID() == triggerID {
cnt += 1
}
}
cnt += len(c.queueTasks)
c.executingMu.RUnlock()
return cnt
}
Expand Down
3 changes: 2 additions & 1 deletion internal/datacoord/compaction_trigger_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ func (m *CompactionTriggerManager) SubmitL0ViewToScheduler(ctx context.Context,
TriggerID: taskID, // inner trigger, use task id as trigger id
PlanID: taskID,
Type: datapb.CompactionType_Level0DeleteCompaction,
StartTime: time.Now().UnixMilli(),
InputSegments: levelZeroSegs,
State: datapb.CompactionTaskState_pipelining,
Channel: view.GetGroupLabel().Channel,
Expand Down Expand Up @@ -271,7 +272,7 @@ func (m *CompactionTriggerManager) SubmitClusteringViewToScheduler(ctx context.C
PlanID: taskID,
TriggerID: view.(*ClusteringSegmentsView).triggerID,
State: datapb.CompactionTaskState_pipelining,
StartTime: int64(view.(*ClusteringSegmentsView).compactionTime.startTime),
StartTime: time.Now().UnixMilli(),
CollectionTtl: view.(*ClusteringSegmentsView).compactionTime.collectionTTL.Nanoseconds(),
TimeoutInSeconds: Params.DataCoordCfg.ClusteringCompactionTimeoutInSeconds.GetAsInt32(),
Type: datapb.CompactionType_ClusteringCompaction,
Expand Down

0 comments on commit 0c4d82c

Please sign in to comment.