diff --git a/internal/datacoord/compaction.go b/internal/datacoord/compaction.go index 375fd0d8a4c69..f3ed92ae6632f 100644 --- a/internal/datacoord/compaction.go +++ b/internal/datacoord/compaction.go @@ -242,8 +242,7 @@ func (c *compactionPlanHandler) schedule() []CompactionTask { switch t.GetType() { case datapb.CompactionType_Level0DeleteCompaction: - if l0ChannelExcludes.Contain(t.GetChannel()) || - mixChannelExcludes.Contain(t.GetChannel()) { + if mixChannelExcludes.Contain(t.GetChannel()) { excluded = append(excluded, t) continue } diff --git a/internal/datacoord/compaction_test.go b/internal/datacoord/compaction_test.go index 2357dd36fc3cb..a199708b05605 100644 --- a/internal/datacoord/compaction_test.go +++ b/internal/datacoord/compaction_test.go @@ -299,6 +299,44 @@ func (s *CompactionPlanHandlerSuite) TestScheduleNodeWithL0Executing() { meta: s.mockMeta, }, }, []UniqueID{10, 13}}, + {"with multiple L0 tasks same channel", []CompactionTask{ + &l0CompactionTask{ + CompactionTask: &datapb.CompactionTask{ + PlanID: 10, + Type: datapb.CompactionType_Level0DeleteCompaction, + State: datapb.CompactionTaskState_pipelining, + Channel: "ch-11", + NodeID: 102, + }, + plan: &datapb.CompactionPlan{PlanID: 10, Channel: "ch-3", Type: datapb.CompactionType_Level0DeleteCompaction}, + sessions: s.mockSessMgr, + meta: s.mockMeta, + }, + &l0CompactionTask{ + CompactionTask: &datapb.CompactionTask{ + PlanID: 11, + Type: datapb.CompactionType_Level0DeleteCompaction, + State: datapb.CompactionTaskState_pipelining, + Channel: "ch-11", + NodeID: 102, + }, + plan: &datapb.CompactionPlan{PlanID: 11, Channel: "ch-3", Type: datapb.CompactionType_Level0DeleteCompaction}, + sessions: s.mockSessMgr, + meta: s.mockMeta, + }, + &l0CompactionTask{ + CompactionTask: &datapb.CompactionTask{ + PlanID: 12, + Type: datapb.CompactionType_Level0DeleteCompaction, + State: datapb.CompactionTaskState_pipelining, + Channel: "ch-11", + NodeID: 102, + }, + plan: &datapb.CompactionPlan{PlanID: 12, Channel: "ch-3", Type: datapb.CompactionType_Level0DeleteCompaction}, + sessions: s.mockSessMgr, + meta: s.mockMeta, + }, + }, []UniqueID{10, 11, 12}}, {"without L0 tasks", []CompactionTask{ &mixCompactionTask{ CompactionTask: &datapb.CompactionTask{