Skip to content

Commit

Permalink
no need to fetch partition number if no need to broadcast
Browse files Browse the repository at this point in the history
  • Loading branch information
3AceShowHand committed Jan 15, 2025
1 parent d04d3b6 commit af18d34
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions downstreamadapter/worker/kafka_ddl_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ func (w *KafkaDDLWorker) WriteBlockEvent(ctx context.Context, event *event.DDLEv
return errors.Trace(err)
}
topic := w.eventRouter.GetTopicForDDL(e)
partitionNum, err := w.topicManager.GetPartitionNum(ctx, topic)
if err != nil {
return errors.Trace(err)
}

if w.partitionRule == PartitionAll {
partitionNum, err := w.topicManager.GetPartitionNum(ctx, topic)
if err != nil {
return errors.Trace(err)
}
err = w.statistics.RecordDDLExecution(func() error {
return w.producer.SyncBroadcastMessage(ctx, topic, partitionNum, message)
})
Expand Down

0 comments on commit af18d34

Please sign in to comment.