diff --git a/server/schedule/operator_controller.go b/server/schedule/operator_controller.go index 60cab347e28d..9a52cae06238 100644 --- a/server/schedule/operator_controller.go +++ b/server/schedule/operator_controller.go @@ -111,18 +111,21 @@ func (oc *OperatorController) pollNeedDispatchRegion() (r *core.RegionInfo, next regionID := item.op.regionID op, ok := oc.operators[regionID] if !ok || op == nil { + log.Info("Debug pop region",zap.Uint64("region-id",regionID)) oc.opNotifierQueue.Pop() return nil, true } r = oc.cluster.GetRegion(regionID) if r == nil { + log.Info("Debug pop region",zap.Uint64("region-id",regionID)) heap.Pop(&oc.opNotifierQueue) return nil, true } step := op.Check(r) if step == nil { + log.Info("Debug pop region",zap.Uint64("region-id",regionID)) heap.Pop(&oc.opNotifierQueue) - return r, true + return nil, true } now := time.Now() if now.UnixNano() < item.time { @@ -143,7 +146,7 @@ func (oc *OperatorController) PushOperators() { if r == nil { continue } - log.Info("actively dispatch operator", zap.Reflect("region", r.GetMeta())) + log.Info("actively dispatch operator", zap.Reflect("operator", oc.GetOperator(r.GetID()))) oc.Dispatch(r) } } @@ -217,7 +220,7 @@ func (oc *OperatorController) addOperatorLocked(op *Operator) bool { } heap.Push(&oc.opNotifierQueue, &operatorWithTime{op: op, time: oc.getNextPushOperatorTime(step,time.Now())}) - log.Info("Push the operator the heap", zap.Reflect("heap", oc.opNotifierQueue)) + log.Info("Push the operator the heap", zap.Reflect("heap", op)) operatorCounter.WithLabelValues(op.Desc(), "create").Inc() return true }