Skip to content

Commit

Permalink
fix parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
3AceShowHand committed Nov 6, 2021
1 parent a02f91e commit c7365ba
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cdc/sink/producer/kafka/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,11 @@ func topicPreProcess(config *Config, saramaConfig *sarama.Config) error {
return nil
}

// topic should have already created by the user, `realPartitionCount` won't be 0.
// if `auto-create-topic` is disabled by user, we would assume topic should have already created
if !ok {
return cerror.ErrKafkaInvalidConfig.GenWithStack("auto-create-topic is false, and topic not found")
}

if config.PartitionNum == 0 {
config.PartitionNum = realPartitionCount
return nil
Expand Down

0 comments on commit c7365ba

Please sign in to comment.