Skip to content

Commit

Permalink
more debugging logs
Browse files Browse the repository at this point in the history
  • Loading branch information
yycptt committed Sep 14, 2022
1 parent 9f7c100 commit 7c4bdaf
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
7 changes: 7 additions & 0 deletions service/history/queues/queue_base.go
Expand Up @@ -310,6 +310,9 @@ func (p *queueBase) processNewRange() {
p.monitor,
newReadScope,
)
if p.category.ID() == tasks.CategoryIDTimer {
p.logger.Info("Merging new slice with range", tag.Value(newSlice.Scope()))
}

reader, ok := p.readerGroup.ReaderByID(DefaultReaderId)
if !ok {
Expand Down Expand Up @@ -381,6 +384,10 @@ func (p *queueBase) rangeCompleteTasks(
if p.category.Type() == tasks.CategoryTypeScheduled {
oldExclusiveDeletionHighWatermark.TaskID = 0
newExclusiveDeletionHighWatermark.TaskID = 0
p.logger.Info("Range completing tasks",
tag.MinQueryLevel(oldExclusiveDeletionHighWatermark.FireTime),
tag.MaxQueryLevel(newExclusiveDeletionHighWatermark.FireTime),
)
}

ctx, cancel := newQueueIOContext()
Expand Down
11 changes: 11 additions & 0 deletions service/history/queues/queue_scheduled.go
Expand Up @@ -98,6 +98,17 @@ func NewScheduledQueue(
// during processing. To compensate for that, add 1ms back when scheduling the task in reader.go.
for _, task := range resp.Tasks {
task.SetVisibilityTime(task.GetVisibilityTime().Truncate(scheduledTaskPrecision))
if retryTimerTask, ok := task.(*tasks.ActivityRetryTimerTask); ok {
logger.Info("Loaded activity retry timer",
tag.WorkflowNamespaceID(task.GetNamespaceID()),
tag.WorkflowID(task.GetWorkflowID()),
tag.WorkflowRunID(task.GetRunID()),
tag.WorkflowScheduledEventID(retryTimerTask.EventID),
tag.Attempt(retryTimerTask.Attempt),
tag.TaskVisibilityTimestamp(task.GetVisibilityTime()),
tag.TaskID(task.GetTaskID()),
)
}
}

for len(resp.Tasks) > 0 && !r.ContainsKey(resp.Tasks[0].GetKey()) {
Expand Down
25 changes: 25 additions & 0 deletions service/history/shard/context_impl.go
Expand Up @@ -1343,6 +1343,31 @@ func (s *ContextImpl) allocateTaskIDsLocked(
visibilityTs := task.GetVisibilityTime()
s.contextTaggedLogger.Debug("Assigning new timer",
tag.Timestamp(visibilityTs), tag.TaskID(task.GetTaskID()), tag.MaxQueryLevel(readCursorTS))
if retryTimerTask, ok := task.(*tasks.ActivityRetryTimerTask); ok {
s.contextTaggedLogger.Info("Generating activity retry timer",
tag.WorkflowNamespaceID(namespaceEntry.ID().String()),
tag.WorkflowID(workflowID),
tag.WorkflowRunID(task.GetRunID()),
tag.WorkflowScheduledEventID(retryTimerTask.EventID),
tag.Attempt(retryTimerTask.Attempt),
tag.Timestamp(visibilityTs),
tag.TaskID(task.GetTaskID()),
tag.CursorTimestamp(readCursorTS),
)
}
if workflowTaskTimeoutTask, ok := task.(*tasks.WorkflowTaskTimeoutTask); ok &&
workflowTaskTimeoutTask.TimeoutType == enums.TIMEOUT_TYPE_SCHEDULE_TO_START {
s.contextTaggedLogger.Info("Generating workflow task timeout timer",
tag.WorkflowNamespaceID(namespaceEntry.ID().String()),
tag.WorkflowID(workflowID),
tag.WorkflowRunID(task.GetRunID()),
tag.WorkflowScheduledEventID(workflowTaskTimeoutTask.EventID),
tag.Attempt(workflowTaskTimeoutTask.ScheduleAttempt),
tag.Timestamp(visibilityTs),
tag.TaskID(task.GetTaskID()),
tag.CursorTimestamp(readCursorTS),
)
}
}
}
}
Expand Down

0 comments on commit 7c4bdaf

Please sign in to comment.