[ 
https://issues.apache.org/jira/browse/KAFKA-1507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14279012#comment-14279012
 ] 

Sriharsha Chintalapani commented on KAFKA-1507:
-----------------------------------------------

[~jkreps] thanks for the comments.  
"We should make having the get metadata request auto-creating topics optional 
and disable it by default (e.g. add an option like 
metadata.requests.auto.create=false)"
currently meta data request checks for broker config 
"auto.create.topics.enable" . This is disabled in my patch.

"We can retain the auto-create functionality in the producer by having it issue 
this request in response to errors about a non-existant topic."
    This is what my current patch does. it sets "auto.create.topics.enable" to 
false on the broker config and when the producer makes TopicMetadataRequest  it 
returns Unknown_Topic_or_partition.  ProducerConfig has new properties like 
"auto.create.topics.enable" . 
If this property set to true( by default) producer issues a new request for 
CreateTopicRequest" upon receiving unknown_topic_or_partition error. which will 
than issues create topic on broker side with the configured numPartitions and 
replicationFactor.

"I don't think we should change the java api of the producer to expose this 
(i.e. add a producer.createTopic(name, replication, partitions, etc). ."

I agree and my patch doesn't change any api of the producer and it doesn't have 
producer.createTopic but it does introduce createTopicRequest and 
createTopicResponse.

"Instead I think we should consider a Java admin client that exposes this 
functionality. This would be where we would expose other operational apis as 
well. The rationale for this is that creating, deleting, and modifying topics 
is actually not part of normal application usage so having it directly exposed 
in the producer is a bit dangerous."

I am not sure if I understand correctly about the java admin client. We already 
have AdminUtils , is this about introducing network apis for 
create/delete/alter topics? . Even in this case I think this patch can be 
useful as the producer just makes createTopicRequest which I think what you 
want unless I missed something :). 




> Using GetOffsetShell against non-existent topic creates the topic 
> unintentionally
> ---------------------------------------------------------------------------------
>
>                 Key: KAFKA-1507
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1507
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.8.1.1
>         Environment: centos
>            Reporter: Luke Forehand
>            Assignee: Sriharsha Chintalapani
>            Priority: Minor
>              Labels: newbie
>         Attachments: KAFKA-1507.patch, KAFKA-1507.patch, 
> KAFKA-1507_2014-07-22_10:27:45.patch, KAFKA-1507_2014-07-23_17:07:20.patch, 
> KAFKA-1507_2014-08-12_18:09:06.patch, KAFKA-1507_2014-08-22_11:06:38.patch, 
> KAFKA-1507_2014-08-22_11:08:51.patch
>
>
> A typo in using GetOffsetShell command can cause a
> topic to be created which cannot be deleted (because deletion is still in
> progress)
> ./kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list
> kafka10:9092,kafka11:9092,kafka12:9092,kafka13:9092 --topic typo --time 1
> ./kafka-topics.sh --zookeeper stormqa1/kafka-prod --describe --topic typo
> Topic:typo      PartitionCount:8        ReplicationFactor:1     Configs:
>          Topic: typo     Partition: 0    Leader: 10      Replicas: 10
>   Isr: 10
> ...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to