Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: husharp <[email protected]>
  • Loading branch information
HuSharp committed Sep 21, 2023
1 parent 96ace89 commit 826304c
Show file tree
Hide file tree
Showing 18 changed files with 269 additions and 146 deletions.
4 changes: 2 additions & 2 deletions pkg/mcs/scheduling/server/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func (c *Cluster) updateScheduler() {
)
// Create the newly added schedulers.
for _, scheduler := range latestSchedulersConfig {
s, err := schedulers.CreateScheduler(
s, err := schedulers.CreateSchedulerWithoutSave(
scheduler.Type,
c.coordinator.GetOperatorController(),
c.storage,
Expand All @@ -252,7 +252,7 @@ func (c *Cluster) updateScheduler() {
zap.Strings("scheduler-args", scheduler.Args))
continue
}
if err := schedulersController.AddScheduler(s, scheduler.Args...); err != nil {
if err := schedulersController.AddScheduler(c.storage, s, scheduler.Args...); err != nil {
log.Error("failed to add scheduler",
zap.String("scheduler-name", name),
zap.Strings("scheduler-args", scheduler.Args),
Expand Down
20 changes: 10 additions & 10 deletions pkg/schedule/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,10 @@ func (c *Coordinator) driveSlowNodeScheduler() {
typ := schedulers.EvictSlowTrendType
args := []string{}

s, err := schedulers.CreateScheduler(typ, c.opController, c.cluster.GetStorage(), schedulers.ConfigSliceDecoder(typ, args), c.schedulers.RemoveScheduler)
s, err := schedulers.CreateSchedulerWithoutSave(typ, c.opController, c.cluster.GetStorage(), schedulers.ConfigSliceDecoder(typ, args), c.schedulers.RemoveScheduler)
if err != nil {
log.Warn("initializing evict-slow-trend scheduler failed", errs.ZapError(err))
} else if err = c.schedulers.AddScheduler(s, args...); err != nil {
} else if err = c.schedulers.AddScheduler(c.cluster.GetStorage(), s, args...); err != nil {
log.Error("can not add scheduler", zap.String("scheduler-name", s.GetName()), zap.Strings("scheduler-args", args), errs.ZapError(err))
}
}
Expand Down Expand Up @@ -452,17 +452,17 @@ func (c *Coordinator) InitSchedulers(needRun bool) {
log.Info("skip create scheduler with independent configuration", zap.String("scheduler-name", name), zap.String("scheduler-type", cfg.Type), zap.Strings("scheduler-args", cfg.Args))
continue
}
s, err := schedulers.CreateScheduler(cfg.Type, c.opController, c.cluster.GetStorage(), schedulers.ConfigJSONDecoder([]byte(data)), c.schedulers.RemoveScheduler)
s, err := schedulers.CreateSchedulerWithoutSave(cfg.Type, c.opController, c.cluster.GetStorage(), schedulers.ConfigJSONDecoder([]byte(data)), c.schedulers.RemoveScheduler)
if err != nil {
log.Error("can not create scheduler with independent configuration", zap.String("scheduler-name", name), zap.Strings("scheduler-args", cfg.Args), errs.ZapError(err))
continue
}
log.Info("create scheduler with independent configuration", zap.String("scheduler-name", s.GetName()))
if needRun {
if err = c.schedulers.AddScheduler(s); err != nil {
if err = c.schedulers.AddScheduler(c.cluster.GetStorage(), s); err != nil {
log.Error("can not add scheduler with independent configuration", zap.String("scheduler-name", s.GetName()), zap.Strings("scheduler-args", cfg.Args), errs.ZapError(err))
}
} else if err = c.schedulers.AddSchedulerHandler(s); err != nil {
} else if err = c.schedulers.AddSchedulerHandler(c.cluster.GetStorage(), s); err != nil {
log.Error("can not add scheduler handler with independent configuration", zap.String("scheduler-name", s.GetName()), zap.Strings("scheduler-args", cfg.Args), errs.ZapError(err))
}
}
Expand All @@ -477,22 +477,22 @@ func (c *Coordinator) InitSchedulers(needRun bool) {
continue
}

s, err := schedulers.CreateScheduler(schedulerCfg.Type, c.opController, c.cluster.GetStorage(), schedulers.ConfigSliceDecoder(schedulerCfg.Type, schedulerCfg.Args), c.schedulers.RemoveScheduler)
s, err := schedulers.CreateSchedulerWithoutSave(schedulerCfg.Type, c.opController, c.cluster.GetStorage(), schedulers.ConfigSliceDecoder(schedulerCfg.Type, schedulerCfg.Args), c.schedulers.RemoveScheduler)
if err != nil {
log.Error("can not create scheduler", zap.String("scheduler-type", schedulerCfg.Type), zap.Strings("scheduler-args", schedulerCfg.Args), errs.ZapError(err))
continue
}

log.Info("create scheduler", zap.String("scheduler-name", s.GetName()), zap.Strings("scheduler-args", schedulerCfg.Args))
if needRun {
if err = c.schedulers.AddScheduler(s, schedulerCfg.Args...); err != nil && !errors.ErrorEqual(err, errs.ErrSchedulerExisted.FastGenByArgs()) {
if err = c.schedulers.AddScheduler(c.cluster.GetStorage(), s, schedulerCfg.Args...); err != nil && !errors.ErrorEqual(err, errs.ErrSchedulerExisted.FastGenByArgs()) {
log.Error("can not add scheduler", zap.String("scheduler-name", s.GetName()), zap.Strings("scheduler-args", schedulerCfg.Args), errs.ZapError(err))
} else {
// Only records the valid scheduler config.
scheduleCfg.Schedulers[k] = schedulerCfg
k++
}
} else if err = c.schedulers.AddSchedulerHandler(s, schedulerCfg.Args...); err != nil && !errors.ErrorEqual(err, errs.ErrSchedulerExisted.FastGenByArgs()) {
} else if err = c.schedulers.AddSchedulerHandler(c.cluster.GetStorage(), s, schedulerCfg.Args...); err != nil && !errors.ErrorEqual(err, errs.ErrSchedulerExisted.FastGenByArgs()) {
log.Error("can not add scheduler handler", zap.String("scheduler-name", s.GetName()), zap.Strings("scheduler-args", schedulerCfg.Args), errs.ZapError(err))
}
}
Expand Down Expand Up @@ -525,14 +525,14 @@ func (c *Coordinator) LoadPlugin(pluginPath string, ch chan string) {
}
schedulerArgs := SchedulerArgs.(func() []string)
// create and add user scheduler
s, err := schedulers.CreateScheduler(schedulerType(), c.opController, c.cluster.GetStorage(), schedulers.ConfigSliceDecoder(schedulerType(), schedulerArgs()), c.schedulers.RemoveScheduler)
s, err := schedulers.CreateSchedulerWithoutSave(schedulerType(), c.opController, c.cluster.GetStorage(), schedulers.ConfigSliceDecoder(schedulerType(), schedulerArgs()), c.schedulers.RemoveScheduler)
if err != nil {
log.Error("can not create scheduler", zap.String("scheduler-type", schedulerType()), errs.ZapError(err))
return
}
log.Info("create scheduler", zap.String("scheduler-name", s.GetName()))
// TODO: handle the plugin in API service mode.
if err = c.schedulers.AddScheduler(s); err != nil {
if err = c.schedulers.AddScheduler(c.cluster.GetStorage(), s); err != nil {
log.Error("can't add scheduler", zap.String("scheduler-name", s.GetName()), errs.ZapError(err))
return
}
Expand Down
48 changes: 24 additions & 24 deletions pkg/schedule/schedulers/balance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func TestBalanceLeaderSchedulerTestSuite(t *testing.T) {

func (suite *balanceLeaderSchedulerTestSuite) SetupTest() {
suite.cancel, suite.conf, suite.tc, suite.oc = prepareSchedulersTest()
lb, err := CreateScheduler(BalanceLeaderType, suite.oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceLeaderType, []string{"", ""}))
lb, err := CreateSchedulerWithoutSave(BalanceLeaderType, suite.oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceLeaderType, []string{"", ""}))
suite.NoError(err)
suite.lb = lb
}
Expand Down Expand Up @@ -580,34 +580,34 @@ func (suite *balanceLeaderRangeSchedulerTestSuite) TestSingleRangeBalance() {
suite.tc.UpdateStoreLeaderWeight(3, 1)
suite.tc.UpdateStoreLeaderWeight(4, 2)
suite.tc.AddLeaderRegionWithRange(1, "a", "g", 1, 2, 3, 4)
lb, err := CreateScheduler(BalanceLeaderType, suite.oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceLeaderType, []string{"", ""}))
lb, err := CreateSchedulerWithoutSave(BalanceLeaderType, suite.oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceLeaderType, []string{"", ""}))
suite.NoError(err)
ops, _ := lb.Schedule(suite.tc, false)
suite.NotEmpty(ops)
suite.Len(ops, 1)
suite.Len(ops[0].Counters, 1)
suite.Len(ops[0].FinishedCounters, 1)
lb, err = CreateScheduler(BalanceLeaderType, suite.oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceLeaderType, []string{"h", "n"}))
lb, err = CreateSchedulerWithoutSave(BalanceLeaderType, suite.oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceLeaderType, []string{"h", "n"}))
suite.NoError(err)
ops, _ = lb.Schedule(suite.tc, false)
suite.Empty(ops)
lb, err = CreateScheduler(BalanceLeaderType, suite.oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceLeaderType, []string{"b", "f"}))
lb, err = CreateSchedulerWithoutSave(BalanceLeaderType, suite.oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceLeaderType, []string{"b", "f"}))
suite.NoError(err)
ops, _ = lb.Schedule(suite.tc, false)
suite.Empty(ops)
lb, err = CreateScheduler(BalanceLeaderType, suite.oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceLeaderType, []string{"", "a"}))
lb, err = CreateSchedulerWithoutSave(BalanceLeaderType, suite.oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceLeaderType, []string{"", "a"}))
suite.NoError(err)
ops, _ = lb.Schedule(suite.tc, false)
suite.Empty(ops)
lb, err = CreateScheduler(BalanceLeaderType, suite.oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceLeaderType, []string{"g", ""}))
lb, err = CreateSchedulerWithoutSave(BalanceLeaderType, suite.oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceLeaderType, []string{"g", ""}))
suite.NoError(err)
ops, _ = lb.Schedule(suite.tc, false)
suite.Empty(ops)
lb, err = CreateScheduler(BalanceLeaderType, suite.oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceLeaderType, []string{"", "f"}))
lb, err = CreateSchedulerWithoutSave(BalanceLeaderType, suite.oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceLeaderType, []string{"", "f"}))
suite.NoError(err)
ops, _ = lb.Schedule(suite.tc, false)
suite.Empty(ops)
lb, err = CreateScheduler(BalanceLeaderType, suite.oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceLeaderType, []string{"b", ""}))
lb, err = CreateSchedulerWithoutSave(BalanceLeaderType, suite.oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceLeaderType, []string{"b", ""}))
suite.NoError(err)
ops, _ = lb.Schedule(suite.tc, false)
suite.Empty(ops)
Expand All @@ -626,7 +626,7 @@ func (suite *balanceLeaderRangeSchedulerTestSuite) TestMultiRangeBalance() {
suite.tc.UpdateStoreLeaderWeight(3, 1)
suite.tc.UpdateStoreLeaderWeight(4, 2)
suite.tc.AddLeaderRegionWithRange(1, "a", "g", 1, 2, 3, 4)
lb, err := CreateScheduler(BalanceLeaderType, suite.oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceLeaderType, []string{"", "g", "o", "t"}))
lb, err := CreateSchedulerWithoutSave(BalanceLeaderType, suite.oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceLeaderType, []string{"", "g", "o", "t"}))
suite.NoError(err)
ops, _ := lb.Schedule(suite.tc, false)
suite.Equal(uint64(1), ops[0].RegionID())
Expand Down Expand Up @@ -664,7 +664,7 @@ func (suite *balanceLeaderRangeSchedulerTestSuite) TestBatchBalance() {

suite.tc.AddLeaderRegionWithRange(uint64(102), "102a", "102z", 1, 2, 3)
suite.tc.AddLeaderRegionWithRange(uint64(103), "103a", "103z", 4, 5, 6)
lb, err := CreateScheduler(BalanceLeaderType, suite.oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceLeaderType, []string{"", ""}))
lb, err := CreateSchedulerWithoutSave(BalanceLeaderType, suite.oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceLeaderType, []string{"", ""}))
suite.NoError(err)
ops, _ := lb.Schedule(suite.tc, false)
suite.Len(ops, 2)
Expand Down Expand Up @@ -755,7 +755,7 @@ func checkBalanceRegionSchedule1(re *require.Assertions, enablePlacementRules bo
tc.SetClusterVersion(versioninfo.MinSupportedVersion(versioninfo.Version4_0))
tc.SetEnablePlacementRules(enablePlacementRules)
tc.SetMaxReplicasWithLabel(enablePlacementRules, 1)
sb, err := CreateScheduler(BalanceRegionType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceRegionType, []string{"", ""}))
sb, err := CreateSchedulerWithoutSave(BalanceRegionType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceRegionType, []string{"", ""}))
re.NoError(err)
// Add stores 1,2,3,4.
tc.AddRegionStore(1, 6)
Expand Down Expand Up @@ -810,7 +810,7 @@ func checkReplica3(re *require.Assertions, enablePlacementRules bool) {
tc.SetEnablePlacementRules(enablePlacementRules)
tc.SetMaxReplicasWithLabel(enablePlacementRules, 3)

sb, err := CreateScheduler(BalanceRegionType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceRegionType, []string{"", ""}))
sb, err := CreateSchedulerWithoutSave(BalanceRegionType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceRegionType, []string{"", ""}))
re.NoError(err)
// Store 1 has the largest region score, so the balance scheduler tries to replace peer in store 1.
tc.AddLabelsStore(1, 16, map[string]string{"zone": "z1", "rack": "r1", "host": "h1"})
Expand Down Expand Up @@ -884,7 +884,7 @@ func checkReplica5(re *require.Assertions, enablePlacementRules bool) {
tc.SetEnablePlacementRules(enablePlacementRules)
tc.SetMaxReplicasWithLabel(enablePlacementRules, 5)

sb, err := CreateScheduler(BalanceRegionType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceRegionType, []string{"", ""}))
sb, err := CreateSchedulerWithoutSave(BalanceRegionType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceRegionType, []string{"", ""}))
re.NoError(err)
tc.AddLabelsStore(1, 4, map[string]string{"zone": "z1", "rack": "r1", "host": "h1"})
tc.AddLabelsStore(2, 5, map[string]string{"zone": "z2", "rack": "r1", "host": "h1"})
Expand Down Expand Up @@ -985,7 +985,7 @@ func checkBalanceRegionSchedule2(re *require.Assertions, enablePlacementRules bo
core.SetApproximateKeys(200),
)

sb, err := CreateScheduler(BalanceRegionType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceRegionType, []string{"", ""}))
sb, err := CreateSchedulerWithoutSave(BalanceRegionType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceRegionType, []string{"", ""}))
re.NoError(err)

tc.AddRegionStore(1, 11)
Expand Down Expand Up @@ -1041,7 +1041,7 @@ func checkBalanceRegionStoreWeight(re *require.Assertions, enablePlacementRules
tc.SetClusterVersion(versioninfo.MinSupportedVersion(versioninfo.Version4_0))
tc.SetEnablePlacementRules(enablePlacementRules)
tc.SetMaxReplicasWithLabel(enablePlacementRules, 1)
sb, err := CreateScheduler(BalanceRegionType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceRegionType, []string{"", ""}))
sb, err := CreateSchedulerWithoutSave(BalanceRegionType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceRegionType, []string{"", ""}))
re.NoError(err)

tc.AddRegionStore(1, 10)
Expand Down Expand Up @@ -1076,7 +1076,7 @@ func checkBalanceRegionOpInfluence(re *require.Assertions, enablePlacementRules
tc.SetClusterVersion(versioninfo.MinSupportedVersion(versioninfo.Version4_0))
tc.SetEnablePlacementRules(enablePlacementRules)
tc.SetMaxReplicasWithLabel(enablePlacementRules, 1)
sb, err := CreateScheduler(BalanceRegionType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceRegionType, []string{"", ""}))
sb, err := CreateSchedulerWithoutSave(BalanceRegionType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceRegionType, []string{"", ""}))
re.NoError(err)
// Add stores 1,2,3,4.
tc.AddRegionStoreWithLeader(1, 2)
Expand Down Expand Up @@ -1112,7 +1112,7 @@ func checkReplacePendingRegion(re *require.Assertions, enablePlacementRules bool
tc.SetClusterVersion(versioninfo.MinSupportedVersion(versioninfo.Version4_0))
tc.SetEnablePlacementRules(enablePlacementRules)
tc.SetMaxReplicasWithLabel(enablePlacementRules, 3)
sb, err := CreateScheduler(BalanceRegionType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceRegionType, []string{"", ""}))
sb, err := CreateSchedulerWithoutSave(BalanceRegionType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceRegionType, []string{"", ""}))
re.NoError(err)
// Store 1 has the largest region score, so the balance scheduler try to replace peer in store 1.
tc.AddLabelsStore(1, 16, map[string]string{"zone": "z1", "rack": "r1", "host": "h1"})
Expand Down Expand Up @@ -1142,7 +1142,7 @@ func TestBalanceRegionShouldNotBalance(t *testing.T) {
cancel, _, tc, oc := prepareSchedulersTest()
defer cancel()
tc.SetClusterVersion(versioninfo.MinSupportedVersion(versioninfo.Version4_0))
sb, err := CreateScheduler(BalanceRegionType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceRegionType, []string{"", ""}))
sb, err := CreateSchedulerWithoutSave(BalanceRegionType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceRegionType, []string{"", ""}))
re.NoError(err)
region := tc.MockRegionInfo(1, 0, []uint64{2, 3, 4}, nil, nil)
tc.PutRegion(region)
Expand All @@ -1155,7 +1155,7 @@ func TestBalanceRegionEmptyRegion(t *testing.T) {
cancel, _, tc, oc := prepareSchedulersTest()
defer cancel()
tc.SetClusterVersion(versioninfo.MinSupportedVersion(versioninfo.Version4_0))
sb, err := CreateScheduler(BalanceRegionType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceRegionType, []string{"", ""}))
sb, err := CreateSchedulerWithoutSave(BalanceRegionType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceRegionType, []string{"", ""}))
re.NoError(err)
tc.AddRegionStore(1, 10)
tc.AddRegionStore(2, 9)
Expand Down Expand Up @@ -1201,7 +1201,7 @@ func checkRandomMergeSchedule(re *require.Assertions, enablePlacementRules bool)
tc.SetMaxReplicasWithLabel(enablePlacementRules, 3)
tc.SetMergeScheduleLimit(1)

mb, err := CreateScheduler(RandomMergeType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(RandomMergeType, []string{"", ""}))
mb, err := CreateSchedulerWithoutSave(RandomMergeType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(RandomMergeType, []string{"", ""}))
re.NoError(err)

tc.AddRegionStore(1, 4)
Expand Down Expand Up @@ -1283,7 +1283,7 @@ func checkScatterRangeBalance(re *require.Assertions, enablePlacementRules bool)
tc.UpdateStoreStatus(uint64(i))
}

hb, err := CreateScheduler(ScatterRangeType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(ScatterRangeType, []string{"s_00", "s_50", "t"}))
hb, err := CreateSchedulerWithoutSave(ScatterRangeType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(ScatterRangeType, []string{"s_00", "s_50", "t"}))
re.NoError(err)

scheduleAndApplyOperator(tc, hb, 100)
Expand Down Expand Up @@ -1357,7 +1357,7 @@ func checkBalanceLeaderLimit(re *require.Assertions, enablePlacementRules bool)

// test not allow schedule leader
tc.SetLeaderScheduleLimit(0)
hb, err := CreateScheduler(ScatterRangeType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(ScatterRangeType, []string{"s_00", "s_50", "t"}))
hb, err := CreateSchedulerWithoutSave(ScatterRangeType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(ScatterRangeType, []string{"s_00", "s_50", "t"}))
re.NoError(err)

scheduleAndApplyOperator(tc, hb, 100)
Expand All @@ -1381,7 +1381,7 @@ func TestConcurrencyUpdateConfig(t *testing.T) {
re := require.New(t)
cancel, _, tc, oc := prepareSchedulersTest()
defer cancel()
hb, err := CreateScheduler(ScatterRangeType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(ScatterRangeType, []string{"s_00", "s_50", "t"}))
hb, err := CreateSchedulerWithoutSave(ScatterRangeType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(ScatterRangeType, []string{"s_00", "s_50", "t"}))
sche := hb.(*scatterRangeScheduler)
re.NoError(err)
ch := make(chan struct{})
Expand Down Expand Up @@ -1454,7 +1454,7 @@ func TestBalanceWhenRegionNotHeartbeat(t *testing.T) {
tc.UpdateStoreStatus(uint64(i))
}

hb, err := CreateScheduler(ScatterRangeType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(ScatterRangeType, []string{"s_00", "s_09", "t"}))
hb, err := CreateSchedulerWithoutSave(ScatterRangeType, oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(ScatterRangeType, []string{"s_00", "s_09", "t"}))
re.NoError(err)

scheduleAndApplyOperator(tc, hb, 100)
Expand Down
2 changes: 1 addition & 1 deletion pkg/schedule/schedulers/balance_witness_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (suite *balanceWitnessSchedulerTestSuite) SetupTest() {
Count: 4,
},
})
lb, err := CreateScheduler(BalanceWitnessType, suite.oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceWitnessType, []string{"", ""}), nil)
lb, err := CreateSchedulerWithoutSave(BalanceWitnessType, suite.oc, storage.NewStorageWithMemoryBackend(), ConfigSliceDecoder(BalanceWitnessType, []string{"", ""}), nil)
suite.NoError(err)
suite.lb = lb
}
Expand Down
Loading

0 comments on commit 826304c

Please sign in to comment.