Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/storage-consumer/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,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
58 changes: 31 additions & 27 deletions downstreamadapter/dispatcher/basic_dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,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 @@ -333,7 +333,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 @@ -403,8 +403,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 @@ -452,7 +451,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 @@ -467,8 +466,13 @@ func (d *BasicDispatcher) handleEvents(dispatcherEvents []DispatcherEvent, wakeC
for _, dispatcherEvent := range dispatcherEvents {
if log.GetLevel() == zapcore.DebugLevel {
log.Debug("dispatcher receive all event",
<<<<<<< HEAD
Comment thread
3AceShowHand marked this conversation as resolved.
Resolved
zap.Stringer("dispatcher", d.id), zap.Int64("mode", d.mode),
zap.String("eventType", commonEvent.TypeToString(dispatcherEvent.Event.GetType())),
=======
zap.Stringer("dispatcherID", d.id), zap.Int64("mode", d.mode),
zap.String("eventType", commonEvent.TypeToString(dispatcherEvent.GetType())),
>>>>>>> f6fd6aa73 (log: honor redaction for span and region keys (#6839))
zap.Any("event", dispatcherEvent.Event))
}

Expand All @@ -486,7 +490,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 All @@ -510,7 +514,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 @@ -548,11 +552,15 @@ 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),
<<<<<<< HEAD
zap.Any("tableSpan", d.GetTableSpan()),
zap.Int64("oldTableID", d.tableSpan.GetTableID()),
zap.Int64("currentTableID", ddl.GetTableID()),
=======
zap.Int64("table", ddl.GetTableID()),
>>>>>>> f6fd6aa73 (log: honor redaction for span and region keys (#6839))
zap.Uint64("commitTs", event.GetCommitTs()),
zap.Uint64("seq", event.GetSeq()))
now := time.Now()
Expand All @@ -578,7 +586,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 @@ -588,12 +596,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 @@ -628,7 +636,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 @@ -667,13 +675,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 @@ -710,7 +718,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 @@ -723,7 +731,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 @@ -1036,8 +1044,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 @@ -1224,9 +1231,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 @@ -1238,7 +1244,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 @@ -1252,16 +1258,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].Event.GetType()),
zap.Uint64("commitTs", dispatcherEvents[len(dispatcherEvents)-1].Event.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 @@ -548,7 +548,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: 2 additions & 2 deletions downstreamadapter/dispatchermanager/dispatcher_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ 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("tableID", tableSpans[idx].TableID),
zap.Int64("startTs", newStartTsList[idx]),
zap.Bool("skipDMLAsStartTs", skipDMLAsStartTs))
}
Expand Down Expand Up @@ -1012,7 +1012,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.Int64("tableID", mergedSpan.TableID))

e.writePathMu.Lock()
if e.writePathClosed.Load() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,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 @@ -176,8 +175,6 @@ 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),
)
return nil, 0, 0
}
Expand Down Expand Up @@ -228,7 +225,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 @@ -241,7 +241,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 @@ -289,7 +288,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.Int64("tableID", mergedSpan.TableID))

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