Skip to content
2 changes: 1 addition & 1 deletion cmd/storage-consumer/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ func (c *consumer) handleNewFiles(
zap.Uint64("tableVersion", key.TableVersion),
zap.Int64("partition", key.PartitionNum),
zap.String("date", key.Date),
zap.String("dispatcher", indexKey.DispatcherID),
zap.String("dispatcherID", indexKey.DispatcherID),
zap.Bool("enableTableAcrossNodes", indexKey.EnableTableAcrossNodes),
zap.Uint64("fileIndex", i),
zap.String("path", filePath))
Expand Down
52 changes: 23 additions & 29 deletions downstreamadapter/dispatcher/basic_dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,13 @@ func (d *BasicDispatcher) InitializeTableSchemaStore(schemaInfo []*heartbeatpb.S
// Because we only need to calculate the tableNames or TableIds in the sink
// when the event dispatcher manager have table trigger event dispatcher
if !d.IsTableTriggerDispatcher() {
log.Error("InitializeTableSchemaStore should only be received by table trigger dispatcher", zap.Any("dispatcher", d.id))
log.Error("InitializeTableSchemaStore should only be received by table trigger dispatcher", zap.Any("dispatcherID", d.id))
return false, errors.ErrChangefeedInitTableTriggerDispatcherFailed.
GenWithStackByArgs("InitializeTableSchemaStore should only be received by table trigger dispatcher")
}

if d.tableSchemaStore != nil {
log.Info("tableSchemaStore has already been initialized", zap.Stringer("dispatcher", d.id))
log.Info("tableSchemaStore has already been initialized", zap.Stringer("dispatcherID", d.id))
return false, nil
}

Expand All @@ -368,7 +368,7 @@ func (d *BasicDispatcher) AddBlockEventToSink(event commonEvent.BlockEvent) erro
// If NotSync is true, it means the DDL should not be sent to downstream.
// So we just call PassBlockEventToSink to update the table progress and call the postFlush func.
if ddl.NotSync {
log.Info("ignore DDL by NotSync", zap.Stringer("dispatcher", d.id), zap.String("ddl", ddl.GetDDLQuery()))
log.Info("ignore DDL by NotSync", zap.Stringer("dispatcherID", d.id), zap.String("ddl", ddl.GetDDLQuery()))
d.PassBlockEventToSink(event)
return nil
}
Expand Down Expand Up @@ -539,8 +539,7 @@ func (d *BasicDispatcher) GetCheckpointTs() uint64 {
func (d *BasicDispatcher) updateDispatcherStatusToWorking() {
log.Info("update dispatcher status to working",
zap.Stringer("changefeedID", d.sharedInfo.changefeedID),
zap.Stringer("dispatcher", d.id),
zap.String("table", common.FormatTableSpan(d.tableSpan)),
zap.Stringer("dispatcherID", d.id),
zap.Uint64("checkpointTs", d.GetCheckpointTs()),
zap.Uint64("resolvedTs", d.GetResolvedTs()),
)
Expand Down Expand Up @@ -590,7 +589,7 @@ func (d *BasicDispatcher) HandleEvents(dispatcherEvents []DispatcherEvent, wakeC
// Return true if should block the dispatcher.
func (d *BasicDispatcher) handleEvents(dispatcherEvents []DispatcherEvent, wakeCallback func()) bool {
if d.GetRemovingStatus() {
log.Warn("dispatcher is removing", zap.Any("id", d.id))
log.Warn("dispatcher is removing", zap.Any("dispatcherID", d.id))
return true
}

Expand All @@ -605,7 +604,7 @@ func (d *BasicDispatcher) handleEvents(dispatcherEvents []DispatcherEvent, wakeC
for _, dispatcherEvent := range dispatcherEvents {
if log.GetLevel() == zapcore.DebugLevel {
log.Debug("dispatcher receive all event",
zap.Stringer("dispatcher", d.id), zap.Int64("mode", d.mode),
zap.Stringer("dispatcherID", d.id), zap.Int64("mode", d.mode),
zap.String("eventType", commonEvent.TypeToString(dispatcherEvent.GetType())),
zap.Any("event", dispatcherEvent.Event))
}
Expand All @@ -624,7 +623,7 @@ func (d *BasicDispatcher) handleEvents(dispatcherEvents []DispatcherEvent, wakeC
zap.Uint64("eventCommitTs", event.GetCommitTs()),
zap.Uint64("seq", event.GetSeq()),
zap.Int("eventType", event.GetType()),
zap.Stringer("dispatcher", d.id))
zap.Stringer("dispatcherID", d.id))
continue
}

Expand Down Expand Up @@ -654,7 +653,7 @@ func (d *BasicDispatcher) handleEvents(dispatcherEvents []DispatcherEvent, wakeC
// while avoiding potential duplicate DML writes at blockTs.
if d.skipDMLAsStartTs && event.GetCommitTs() == d.startTs+1 {
log.Info("skip DML event at startTs+1 due to skipDMLAsStartTs",
zap.Stringer("dispatcher", d.id),
zap.Stringer("dispatcherID", d.id),
zap.Uint64("startTs", d.startTs),
zap.Uint64("dmlCommitTs", event.GetCommitTs()),
zap.Uint64("seq", event.GetSeq()))
Expand Down Expand Up @@ -697,9 +696,8 @@ func (d *BasicDispatcher) handleEvents(dispatcherEvents []DispatcherEvent, wakeC
}

log.Info("dispatcher receive ddl event",
zap.Stringer("dispatcher", d.id),
zap.Stringer("dispatcherID", d.id),
zap.String("query", ddl.Query),
zap.Any("tableSpan", d.GetTableSpan()),
zap.Int64("table", ddl.GetTableID()),
zap.Uint64("commitTs", event.GetCommitTs()),
zap.Uint64("seq", event.GetSeq()))
Expand All @@ -726,7 +724,7 @@ func (d *BasicDispatcher) handleEvents(dispatcherEvents []DispatcherEvent, wakeC
block = true
syncPoint := event.(*commonEvent.SyncPointEvent)
log.Info("dispatcher receive sync point event",
zap.Stringer("dispatcher", d.id),
zap.Stringer("dispatcherID", d.id),
zap.Uint64("commitTs", syncPoint.GetCommitTs()),
zap.Uint64("seq", event.GetSeq()))

Expand All @@ -736,12 +734,12 @@ func (d *BasicDispatcher) handleEvents(dispatcherEvents []DispatcherEvent, wakeC
d.DealWithBlockEvent(syncPoint)
case commonEvent.TypeHandshakeEvent:
log.Warn("Receive handshake event unexpectedly",
zap.Stringer("dispatcher", d.id),
zap.Stringer("dispatcherID", d.id),
zap.Any("event", event))
default:
log.Panic("Unexpected event type",
zap.Int("eventType", event.GetType()),
zap.Stringer("dispatcher", d.id),
zap.Stringer("dispatcherID", d.id),
zap.Uint64("commitTs", event.GetCommitTs()))
}
}
Expand Down Expand Up @@ -780,7 +778,7 @@ func (d *BasicDispatcher) HandleDispatcherStatus(dispatcherStatus *heartbeatpb.D
if logger.IsDebugEnabled() {
log.Debug("dispatcher handle dispatcher status",
zap.String("dispatcherStatus", common.FormatDispatcherStatus(dispatcherStatus)),
zap.Stringer("dispatcher", d.id),
zap.Stringer("dispatcherID", d.id),
zap.Any("action", dispatcherStatus.GetAction()),
zap.Any("ack", dispatcherStatus.GetAck()))
}
Expand Down Expand Up @@ -819,13 +817,13 @@ func (d *BasicDispatcher) HandleDispatcherStatus(dispatcherStatus *heartbeatpb.D
log.Debug("pending event is nil, and the action's commit is larger than dispatchers resolvedTs",
zap.Uint64("resolvedTs", d.GetResolvedTs()),
zap.Uint64("actionCommitTs", action.CommitTs),
zap.Stringer("dispatcher", d.id))
zap.Stringer("dispatcherID", d.id))
// we have not received the block event, and the action is for the future event, so just ignore
return false
}
if d.blockEventStatus.actionMatchs(action) {
log.Info("pending event get the action",
zap.Stringer("dispatcher", d.id),
zap.Stringer("dispatcherID", d.id),
zap.Int64("mode", d.mode),
zap.Any("action", action),
zap.Any("innerAction", int(action.Action)),
Expand Down Expand Up @@ -862,7 +860,7 @@ func (d *BasicDispatcher) HandleDispatcherStatus(dispatcherStatus *heartbeatpb.D
return true
default:
log.Error("unsupported action type",
zap.Stringer("dispatcher", d.id),
zap.Stringer("dispatcherID", d.id),
zap.Int("action", int(action.Action)),
zap.Uint64("commitTs", action.CommitTs),
zap.Bool("isSyncPoint", action.IsSyncPoint))
Expand All @@ -875,7 +873,7 @@ func (d *BasicDispatcher) HandleDispatcherStatus(dispatcherStatus *heartbeatpb.D
log.Debug("pending event's commitTs is smaller than the action's commitTs, just ignore it",
zap.Uint64("pendingEventCommitTs", ts),
zap.Uint64("actionCommitTs", action.CommitTs),
zap.Stringer("dispatcher", d.id))
zap.Stringer("dispatcherID", d.id))
return false
}
}
Expand Down Expand Up @@ -1188,8 +1186,7 @@ func (d *BasicDispatcher) DealWithBlockEvent(event commonEvent.BlockEvent) {
log.Error("Wrong Schema ID",
zap.Stringer("dispatcherID", d.id),
zap.Int64("exceptSchemaID", schemaIDChange.OldSchemaID),
zap.Int64("actualSchemaID", d.schemaID),
zap.String("tableSpan", common.FormatTableSpan(d.tableSpan)))
zap.Int64("actualSchemaID", d.schemaID))
return
} else {
d.schemaID = schemaIDChange.NewSchemaID
Expand Down Expand Up @@ -1376,9 +1373,8 @@ func (d *BasicDispatcher) TryClose() (w heartbeatpb.Watermark, ok bool) {
}
log.Info("dispatcher component has stopped and is ready for cleanup",
zap.Stringer("changefeedID", d.sharedInfo.changefeedID),
zap.Stringer("dispatcher", d.id),
zap.Stringer("dispatcherID", d.id),
zap.Int64("mode", d.mode),
zap.String("table", common.FormatTableSpan(d.tableSpan)),
zap.Uint64("checkpointTs", d.GetCheckpointTs()),
zap.Uint64("resolvedTs", d.GetResolvedTs()),
)
Expand All @@ -1390,7 +1386,7 @@ func (d *BasicDispatcher) TryClose() (w heartbeatpb.Watermark, ok bool) {
}
log.Info("dispatcher is not ready to close",
zap.Stringer("changefeedID", d.sharedInfo.changefeedID),
zap.Stringer("dispatcher", d.id),
zap.Stringer("dispatcherID", d.id),
zap.Int64("mode", d.mode),
zap.Bool("sinkIsNormal", d.sink.IsNormal()),
zap.Bool("tableProgressEmpty", d.tableProgress.Empty()),
Expand All @@ -1404,16 +1400,14 @@ func (d *BasicDispatcher) TryClose() (w heartbeatpb.Watermark, ok bool) {
func (d *BasicDispatcher) removeDispatcher() {
log.Info("remove dispatcher",
zap.Stringer("changefeedID", d.sharedInfo.changefeedID),
zap.Stringer("dispatcher", d.id),
zap.Int64("mode", d.mode),
zap.String("table", common.FormatTableSpan(d.tableSpan)))
zap.Stringer("dispatcherID", d.id),
zap.Int64("mode", d.mode))
dispatcherStatusDS := GetDispatcherStatusDynamicStream()
err := dispatcherStatusDS.RemovePath(d.id)
if err != nil {
log.Error("remove dispatcher from dynamic stream failed",
zap.Stringer("changefeedID", d.sharedInfo.changefeedID),
zap.Stringer("dispatcher", d.id),
zap.String("table", common.FormatTableSpan(d.tableSpan)),
zap.Stringer("dispatcherID", d.id),
zap.Uint64("checkpointTs", d.GetCheckpointTs()),
zap.Uint64("resolvedTs", d.GetResolvedTs()),
zap.Error(err))
Expand Down
6 changes: 3 additions & 3 deletions downstreamadapter/dispatcher/event_dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (d *EventDispatcher) cache(dispatcherEvents []DispatcherEvent, wakeCallback
d.cacheEvents.Lock()
defer d.cacheEvents.Unlock()
if d.GetRemovingStatus() {
log.Warn("dispatcher has removed", zap.Any("id", d.id))
log.Warn("dispatcher has removed", zap.Any("dispatcherID", d.id))
return
}
// Here we have to create a new event slice, because dispatcherEvents will be cleaned up in dynamic stream
Expand All @@ -128,15 +128,15 @@ func (d *EventDispatcher) cache(dispatcherEvents []DispatcherEvent, wakeCallback
select {
case d.cacheEvents.events <- cacheEvents:
log.Debug("cache events",
zap.Stringer("dispatcher", d.id),
zap.Stringer("dispatcherID", d.id),
zap.Uint64("dispatcherResolvedTs", d.GetResolvedTs()),
zap.Int("length", len(dispatcherEvents)),
zap.Int("eventType", dispatcherEvents[len(dispatcherEvents)-1].GetType()),
zap.Uint64("commitTs", dispatcherEvents[len(dispatcherEvents)-1].GetCommitTs()),
zap.Uint64("redoGlobalTs", d.redoGlobalTs.Load()),
)
default:
log.Panic("dispatcher cache events is full", zap.Stringer("dispatcher", d.id), zap.Int("len", len(d.cacheEvents.events)))
log.Panic("dispatcher cache events is full", zap.Stringer("dispatcherID", d.id), zap.Int("len", len(d.cacheEvents.events)))
}
}

Expand Down
4 changes: 2 additions & 2 deletions downstreamadapter/dispatcher/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (r *ResendTaskMap) Get(identifier BlockEventIdentifier) *ResendTask {
}

func (r *ResendTaskMap) Set(identifier BlockEventIdentifier, task *ResendTask) {
log.Info("set resend task", zap.Any("identifier", identifier), zap.Any("taskDispatcherID", task.dispatcher.GetId()))
log.Info("set resend task", zap.Any("identifier", identifier), zap.Any("dispatcherID", task.dispatcher.GetId()))
r.mutex.Lock()
defer r.mutex.Unlock()
r.m[identifier] = task
Expand Down Expand Up @@ -547,7 +547,7 @@ func addToStatusDynamicStream(d Dispatcher) {
if err != nil {
log.Error("add dispatcher to dynamic stream failed",
zap.Stringer("changefeedID", d.GetChangefeedID()),
zap.Stringer("dispatcher", d.GetId()),
zap.Stringer("dispatcherID", d.GetId()),
zap.Error(err))
}
}
2 changes: 1 addition & 1 deletion downstreamadapter/dispatcher/redo_dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (rd *RedoDispatcher) GetRedoMeta() *redo.RedoMeta {
// only for table trigger redo dispatcher
func (rd *RedoDispatcher) SetRedoMeta(ctx context.Context, cfg *config.ConsistentConfig) {
if !rd.IsTableTriggerDispatcher() {
log.Error("SetRedoMeta should be called by table trigger redo dispatcher", zap.Any("id", rd.GetId()))
log.Error("SetRedoMeta should be called by table trigger redo dispatcher", zap.Any("dispatcherID", rd.GetId()))
}
ctx, rd.cancel = context.WithCancel(ctx)
rd.redoMeta = redo.NewRedoMeta(rd.sharedInfo.changefeedID, rd.startTs, cfg)
Expand Down
4 changes: 1 addition & 3 deletions downstreamadapter/dispatchermanager/dispatcher_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,6 @@ func (e *DispatcherManager) newEventDispatchers(infos map[common.DispatcherID]di
log.Info("new dispatcher created",
zap.Stringer("changefeedID", e.changefeedID),
zap.Stringer("dispatcherID", id),
zap.String("tableSpan", common.FormatTableSpan(tableSpans[idx])),
zap.Int64("startTs", newStartTsList[idx]),
zap.Bool("skipDMLAsStartTs", skipDMLAsStartTs))
}
Expand Down Expand Up @@ -1041,8 +1040,7 @@ func (e *DispatcherManager) mergeEventDispatcher(dispatcherIDs []common.Dispatch

log.Info("new dispatcher created(merge dispatcher)",
zap.Stringer("changefeedID", e.changefeedID),
zap.Stringer("dispatcherID", mergedDispatcherID),
zap.String("tableSpan", common.FormatTableSpan(mergedSpan)))
zap.Stringer("dispatcherID", mergedDispatcherID))

e.writePathMu.Lock()
if e.writePathClosed.Load() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ func getDispatcherStatus(id common.DispatcherID, dispatcherItem dispatcher.Dispa
log.Debug("dispatcher is initializing",
zap.Stringer("changefeedID", dispatcherItem.GetChangefeedID()),
zap.Stringer("dispatcherID", id),
zap.String("tableSpan", common.FormatTableSpan(dispatcherItem.GetTableSpan())),
zap.Any("componentStatus", dispatcherItem.GetComponentStatus()),
)
return nil, nil, &heartBeatInfo.Watermark
Expand Down Expand Up @@ -177,8 +176,8 @@ func createMergedSpan[T dispatcher.Dispatcher](changefeedID common.ChangeFeedID,
zap.Stringer("changefeedID", changefeedID),
zap.Any("dispatcherIDs", dispatcherIDs),
zap.Int64("mode", dispatcherItem.GetMode()),
zap.Any("prevTableSpan", prevTableSpan),
zap.Any("currentTableSpan", currentTableSpan),
zap.String("prevTableSpan", common.FormatTableSpan(prevTableSpan)),
zap.String("currentTableSpan", common.FormatTableSpan(currentTableSpan)),
)
return nil, 0, 0
}
Expand Down Expand Up @@ -229,7 +228,6 @@ func registerMergeDispatcher[T dispatcher.Dispatcher](changefeedID common.Change
zap.Stringer("changefeedID", changefeedID),
zap.Stringer("dispatcherID", mergedDispatcher.GetId()),
zap.Int64("mode", mergedDispatcher.GetMode()),
zap.Any("tableSpan", common.FormatTableSpan(mergedDispatcher.GetTableSpan())),
)
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ func (e *DispatcherManager) newRedoDispatchers(infos map[common.DispatcherID]dis
log.Info("new redo dispatcher created",
zap.Stringer("changefeedID", e.changefeedID),
zap.Stringer("dispatcherID", id),
zap.String("tableSpan", common.FormatTableSpan(tableSpans[idx])),
zap.Int64("startTs", startTsList[idx]),
zap.Bool("skipDMLAsStartTs", scheduleSkipDMLAsStartTsList[idx]))
}
Expand Down Expand Up @@ -287,8 +286,7 @@ func (e *DispatcherManager) mergeRedoDispatcher(dispatcherIDs []common.Dispatche

log.Info("new redo dispatcher created(merge dispatcher)",
zap.Stringer("changefeedID", e.changefeedID),
zap.Stringer("dispatcherID", mergedDispatcherID),
zap.String("tableSpan", common.FormatTableSpan(mergedSpan)))
zap.Stringer("dispatcherID", mergedDispatcherID))

e.writePathMu.Lock()
if e.writePathClosed.Load() {
Expand Down
11 changes: 5 additions & 6 deletions downstreamadapter/dispatchermanager/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func abortMerge[T dispatcher.Dispatcher](t *MergeCheckTask, dispatcherMap *Dispa
zap.String("reason", reason),
zap.Int64("mode", t.mergedDispatcher.GetMode()),
zap.Any("dispatcherIDs", t.dispatcherIDs),
zap.Any("mergedDispatcher", t.mergedDispatcher.GetId()),
zap.Any("dispatcherID", t.mergedDispatcher.GetId()),
)

// Stop retrying and cleanup best-effort.
Expand Down Expand Up @@ -235,7 +235,7 @@ func doMerge[T dispatcher.Dispatcher](t *MergeCheckTask, dispatcherMap *Dispatch
zap.Stringer("changefeedID", t.manager.changefeedID),
zap.Int64("mode", t.mergedDispatcher.GetMode()),
zap.Any("dispatcherIDs", t.dispatcherIDs),
zap.Any("mergedDispatcher", t.mergedDispatcher.GetId()),
zap.Any("dispatcherID", t.mergedDispatcher.GetId()),
)
sinkType := getSinkType(t.mergedDispatcher, t.manager)

Expand Down Expand Up @@ -284,7 +284,7 @@ func doMerge[T dispatcher.Dispatcher](t *MergeCheckTask, dispatcherMap *Dispatch
zap.Int("total", len(t.dispatcherIDs)),
zap.Int("count", count),
zap.Int64("mode", t.mergedDispatcher.GetMode()),
zap.Any("mergedDispatcher", t.mergedDispatcher.GetId()),
zap.Any("dispatcherID", t.mergedDispatcher.GetId()),
)
}

Expand All @@ -305,7 +305,6 @@ func doMerge[T dispatcher.Dispatcher](t *MergeCheckTask, dispatcherMap *Dispatch
zap.Stringer("changefeedID", t.manager.changefeedID),
zap.Stringer("dispatcherID", t.mergedDispatcher.GetId()),
zap.Int64("mode", t.mergedDispatcher.GetMode()),
zap.Any("tableSpan", common.FormatTableSpan(t.mergedDispatcher.GetTableSpan())),
zap.Uint64("startTs", startTs),
)

Expand Down Expand Up @@ -467,11 +466,11 @@ func resolveMergedDispatcherStartTs(t *MergeCheckTask, minCheckpointTs uint64, p
log.Warn("pending ddl has zero commit ts, fallback to min checkpoint ts",
zap.Stringer("changefeedID", t.manager.changefeedID),
zap.Uint64("minCheckpointTs", minCheckpointTs),
zap.Any("mergedDispatcher", t.mergedDispatcher.GetId()))
zap.Any("dispatcherID", t.mergedDispatcher.GetId()))
}
log.Info("merge dispatcher uses pending block event to calculate start ts",
zap.Stringer("changefeedID", t.manager.changefeedID),
zap.Any("mergedDispatcher", t.mergedDispatcher.GetId()),
zap.Any("dispatcherID", t.mergedDispatcher.GetId()),
zap.Uint64("pendingCommitTs", candidate.pendingCommitTs),
zap.Bool("pendingIsSyncPoint", candidate.pendingIsSyncPoint),
zap.Uint64("startTs", candidate.startTs),
Expand Down
Loading
Loading