mirror of https://github.com/milvus-io/milvus.git
enhance: modify log to avoid ambiguity and improve readability (#28331)
Signed-off-by: yah01 <yah2er0ne@outlook.com>pull/28233/head
parent
3920bbc55f
commit
70995383bf
|
@ -551,10 +551,10 @@ func (scheduler *taskScheduler) schedule(node int64) {
|
|||
|
||||
// The scheduler doesn't limit the number of tasks,
|
||||
// to commit tasks to executors as soon as possible, to reach higher merge possibility
|
||||
failCount := atomic.NewInt32(0)
|
||||
commmittedNum := atomic.NewInt32(0)
|
||||
funcutil.ProcessFuncParallel(len(toProcess), hardware.GetCPUNum(), func(idx int) error {
|
||||
if !scheduler.process(toProcess[idx]) {
|
||||
failCount.Inc()
|
||||
if scheduler.process(toProcess[idx]) {
|
||||
commmittedNum.Inc()
|
||||
}
|
||||
return nil
|
||||
}, "process")
|
||||
|
@ -565,7 +565,7 @@ func (scheduler *taskScheduler) schedule(node int64) {
|
|||
|
||||
log.Info("processed tasks",
|
||||
zap.Int("toProcessNum", len(toProcess)),
|
||||
zap.Int32("failCount", failCount.Load()),
|
||||
zap.Int32("committedNum", commmittedNum.Load()),
|
||||
zap.Int("toRemoveNum", len(toRemove)),
|
||||
)
|
||||
|
||||
|
@ -689,7 +689,7 @@ func (scheduler *taskScheduler) recordSegmentTaskError(task *SegmentTask) {
|
|||
zap.Int64("collectionID", task.CollectionID()),
|
||||
zap.Int64("replicaID", task.ReplicaID()),
|
||||
zap.Int64("segmentID", task.SegmentID()),
|
||||
zap.Int32("taskStatus", task.Status()),
|
||||
zap.String("status", task.Status()),
|
||||
zap.Error(task.err),
|
||||
)
|
||||
meta.GlobalFailedLoadCache.Put(task.collectionID, task.Err())
|
||||
|
@ -700,7 +700,7 @@ func (scheduler *taskScheduler) remove(task Task) {
|
|||
zap.Int64("taskID", task.ID()),
|
||||
zap.Int64("collectionID", task.CollectionID()),
|
||||
zap.Int64("replicaID", task.ReplicaID()),
|
||||
zap.Int32("taskStatus", task.Status()),
|
||||
zap.String("status", task.Status()),
|
||||
)
|
||||
task.Cancel(nil)
|
||||
scheduler.tasks.Remove(task.ID())
|
||||
|
@ -725,7 +725,7 @@ func (scheduler *taskScheduler) remove(task Task) {
|
|||
}
|
||||
|
||||
scheduler.updateTaskMetrics()
|
||||
log.Debug("task removed", zap.Stack("stack"))
|
||||
log.Info("task removed")
|
||||
}
|
||||
|
||||
func (scheduler *taskScheduler) checkStale(task Task) error {
|
||||
|
|
|
@ -33,16 +33,16 @@ import (
|
|||
)
|
||||
|
||||
type (
|
||||
Status = int32
|
||||
Status = string
|
||||
Priority int32
|
||||
)
|
||||
|
||||
const (
|
||||
TaskStatusCreated Status = iota + 1
|
||||
TaskStatusStarted
|
||||
TaskStatusSucceeded
|
||||
TaskStatusCanceled
|
||||
TaskStatusFailed
|
||||
TaskStatusCreated = "created"
|
||||
TaskStatusStarted = "started"
|
||||
TaskStatusSucceeded = "succeeded"
|
||||
TaskStatusCanceled = "canceled"
|
||||
TaskStatusFailed = "failed"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -107,7 +107,7 @@ type baseTask struct {
|
|||
loadType querypb.LoadType
|
||||
|
||||
source Source
|
||||
status *atomic.Int32
|
||||
status *atomic.String
|
||||
priority Priority
|
||||
err error
|
||||
actions []Action
|
||||
|
@ -128,7 +128,7 @@ func newBaseTask(ctx context.Context, source Source, collectionID, replicaID Uni
|
|||
replicaID: replicaID,
|
||||
shard: shard,
|
||||
|
||||
status: atomic.NewInt32(TaskStatusStarted),
|
||||
status: atomic.NewString(TaskStatusStarted),
|
||||
priority: TaskPriorityNormal,
|
||||
ctx: ctx,
|
||||
cancel: cancel,
|
||||
|
|
Loading…
Reference in New Issue