From 7889b677fd1acb67553752660b698f4e2aa6108b Mon Sep 17 00:00:00 2001 From: lhy1024 Date: Thu, 19 Dec 2024 18:40:06 +0800 Subject: [PATCH] scheduler: fix panic in grant hot region scheduler (#8934) close tikv/pd#8933 Signed-off-by: lhy1024 Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com> --- pkg/schedule/schedulers/grant_hot_region.go | 4 ++++ pkg/schedule/schedulers/hot_region.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/schedule/schedulers/grant_hot_region.go b/pkg/schedule/schedulers/grant_hot_region.go index 837d7290ff7..79be126f1d4 100644 --- a/pkg/schedule/schedulers/grant_hot_region.go +++ b/pkg/schedule/schedulers/grant_hot_region.go @@ -320,6 +320,10 @@ func (s *grantHotRegionScheduler) transfer(cluster sche.SchedulerCluster, region } else { op, err = operator.CreateMovePeerOperator(s.GetName()+"-move", cluster, srcRegion, operator.OpRegion|operator.OpLeader, srcStore.GetID(), dstStore) } + if err != nil { + log.Debug("fail to create grant hot leader operator", errs.ZapError(err)) + return + } op.SetPriorityLevel(constant.High) return } diff --git a/pkg/schedule/schedulers/hot_region.go b/pkg/schedule/schedulers/hot_region.go index 622e617b729..2ba9af782db 100644 --- a/pkg/schedule/schedulers/hot_region.go +++ b/pkg/schedule/schedulers/hot_region.go @@ -1352,7 +1352,7 @@ func (bs *balanceSolver) splitBucketsOperator(region *core.RegionInfo, keys [][] op, err := operator.CreateSplitRegionOperator(desc, region, operator.OpSplit, pdpb.CheckPolicy_USEKEY, splitKeys) if err != nil { - log.Error("fail to create split operator", + log.Debug("fail to create split operator", zap.Stringer("resource-type", bs.resourceTy), errs.ZapError(err)) return nil