Skip to content

Commit

Permalink
enhance: enable parallel execution of L0 compactions (#36816) (#36985)
Browse files Browse the repository at this point in the history
pr: #36816

Signed-off-by: Ted Xu <[email protected]>
  • Loading branch information
tedxu authored Oct 18, 2024
1 parent b88d610 commit 2742524
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
3 changes: 1 addition & 2 deletions internal/datacoord/compaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
38 changes: 38 additions & 0 deletions internal/datacoord/compaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 2742524

Please sign in to comment.