Skip to content

Commit 2808f3b

Browse files
committed
add some comments
1 parent 766dba2 commit 2808f3b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

pkg/ttl/ttlworker/task_manager.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,23 @@ func (m *taskManager) lockScanTask(se session.Session, task *cache.TTLTask, now
416416
return errors.WithStack(errTooManyRunningTasks)
417417
}
418418

419+
if task.OwnerID != "" {
420+
logutil.Logger(m.ctx).Info(
421+
"try to lock a heartbeat timeout task",
422+
zap.String("jobID", task.JobID),
423+
zap.Int64("scanID", task.ScanID),
424+
zap.String("prevOwner", task.OwnerID),
425+
zap.Time("lastHeartbeat", task.OwnerHBTime),
426+
)
427+
} else if task.State != nil && task.State.PreviousOwner != "" {
428+
logutil.Logger(m.ctx).Info(
429+
"try to lock a task resigned from another instance",
430+
zap.String("jobID", task.JobID),
431+
zap.Int64("scanID", task.ScanID),
432+
zap.String("prevOwner", task.State.PreviousOwner),
433+
)
434+
}
435+
419436
intest.Assert(se.GetSessionVars().Location().String() == now.Location().String())
420437
sql, args := setTTLTaskOwnerSQL(task.JobID, task.ScanID, m.id, now)
421438
_, err = se.ExecuteSQL(ctx, sql, args...)

0 commit comments

Comments
 (0)