Skip to content

Commit

Permalink
debug log
Browse files Browse the repository at this point in the history
Signed-off-by: nolouch <nolouch@gmail.com>
  • Loading branch information
nolouch committed May 15, 2019
1 parent 3c96cea commit 2fc74f0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions server/schedule/operator_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
}
}
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 2fc74f0

Please sign in to comment.