From 274252450849adbc25eeb2ed60bdcc4bf83667d2 Mon Sep 17 00:00:00 2001 From: Ted Xu Date: Fri, 18 Oct 2024 16:17:25 +0800 Subject: [PATCH] enhance: enable parallel execution of L0 compactions (#36816) (#36985) pr: #36816 Signed-off-by: Ted Xu --- internal/datacoord/compaction.go | 3 +-- internal/datacoord/compaction_test.go | 38 +++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/internal/datacoord/compaction.go b/internal/datacoord/compaction.go index 25467e0a29541..9aed0aa14d5ff 100644 --- a/internal/datacoord/compaction.go +++ b/internal/datacoord/compaction.go @@ -239,8 +239,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 fcfc3039abc00..40ef615b0dcba 100644 --- a/internal/datacoord/compaction_test.go +++ b/internal/datacoord/compaction_test.go @@ -296,6 +296,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{