> On Aug. 13, 2014, 11:13 p.m., Neha Narkhede wrote:
> > core/src/main/scala/kafka/server/KafkaApis.scala, line 454
> > <https://reviews.apache.org/r/24621/diff/2/?file=658943#file658943line454>
> >
> >     we cannot have metadata request handling access zookeeper. In the past, 
> > we've gotten bitten by the kind of slowdown the zk access causes. 
> >     
> >     Besides, I think this check is not required. In the case that the 
> > metadata cache is not updated but the topic is in zookeeper, we could just 
> > return UnknownTopicOrPartitionCode and explicitly state that create topic 
> > is not a sync operation.

I agree on removing topicExists call. The reason I used it here  client queries 
topicMetadataInfo and if it isn't in metadataCache it will either check if the 
topic is already created or return UnknownTopicOrPartitionCode. If its unknown 
topic than I am initiating a createTopic request from the producer. So I needed 
a way to tell the producer once the createTopic is done the follow-up topic 
metadata response indicate that the topic exists but not in the metadata cache 
yet. I am working on this to fix it.


- Sriharsha


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/24621/#review50500
-----------------------------------------------------------


On Aug. 22, 2014, 6:08 p.m., Sriharsha Chintalapani wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/24621/
> -----------------------------------------------------------
> 
> (Updated Aug. 22, 2014, 6:08 p.m.)
> 
> 
> Review request for kafka.
> 
> 
> Bugs: KAFKA-1507
>     https://issues.apache.org/jira/browse/KAFKA-1507
> 
> 
> Repository: kafka
> 
> 
> Description
> -------
> 
> KAFKA-1507. Using GetOffsetShell against non-existent topic creates the     
> topic unintentionally. Added CreateTopicRequest to the protocol ,     removed 
> create topic from TopicMetadataRequest.
> 
> 
> KAFKA-1507. Using GetOffsetShell against non-existent topic creates the topic 
> unintentionally. Added CreateTopicRequest to the protocol ,     removed 
> create topic from TopicMetadataRequest.
> 
> 
> KAFKA-1507. Using GetOffsetShell against non-existent topic creates the topic 
> unintentionally. Added CreateTopicRequest to the protocol ,     removed 
> create topic from TopicMetadataRequest.
> 
> 
> KAFKA-1507. Using GetOffsetShell against non-existent topic creates the topic 
> unintentionally. Added CreateTopicRequest to the protocol , removed create 
> topic from TopicMetadataRequest. Merge changes.
> 
> 
> KAFKA-1507. Using GetOffsetShell against non-existent topic creates the topic 
> unintentionally. Added CreateTopicRequest to the protocol , removed create 
> topic from TopicMetadataRequest. Updated doc in Errors.
> 
> 
> Diffs
> -----
> 
>   clients/src/main/java/org/apache/kafka/clients/NetworkClient.java 
> eea270abb16f40c9f3b47c4ea96be412fb4fdc8b 
>   clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java 
> f58b8508d3f813a51015abed772c704390887d7e 
>   clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java 
> f9de4af426449cceca12a8de9a9f54a6241d28d8 
>   
> clients/src/main/java/org/apache/kafka/common/errors/TopicCreationFailedException.java
>  PRE-CREATION 
>   
> clients/src/main/java/org/apache/kafka/common/errors/TopicExistsException.java
>  PRE-CREATION 
>   clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java 
> 109fc965e09b2ed186a073351bd037ac8af20a4c 
>   clients/src/main/java/org/apache/kafka/common/protocol/Errors.java 
> d434f420ad63406ee2a2fde9435762ae027d85f3 
>   clients/src/main/java/org/apache/kafka/common/protocol/Protocol.java 
> 7517b879866fc5dad5f8d8ad30636da8bbe7784a 
>   
> clients/src/main/java/org/apache/kafka/common/requests/CreateTopicRequest.java
>  PRE-CREATION 
>   
> clients/src/main/java/org/apache/kafka/common/requests/CreateTopicResponse.java
>  PRE-CREATION 
>   clients/src/test/java/org/apache/kafka/clients/NetworkClientTest.java 
> 1a55242e9399fa4669630b55110d530f954e1279 
>   
> clients/src/test/java/org/apache/kafka/common/requests/RequestResponseTest.java
>  df37fc6d8f0db0b8192a948426af603be3444da4 
>   core/src/main/scala/kafka/api/CreateTopicRequest.scala PRE-CREATION 
>   core/src/main/scala/kafka/api/CreateTopicResponse.scala PRE-CREATION 
>   core/src/main/scala/kafka/api/CreateTopicResult.scala PRE-CREATION 
>   core/src/main/scala/kafka/api/RequestKeys.scala 
> c24c0345feedc7b9e2e9f40af11bfa1b8d328c43 
>   core/src/main/scala/kafka/client/ClientUtils.scala 
> ce7ede3f6d60e756e252257bd8c6fedc21f21e1c 
>   core/src/main/scala/kafka/common/ErrorMapping.scala 
> 3fae7910e4ce17bc8325887a046f383e0c151d44 
>   core/src/main/scala/kafka/javaapi/CreateTopicRequest.scala PRE-CREATION 
>   core/src/main/scala/kafka/javaapi/CreateTopicResponse.scala PRE-CREATION 
>   core/src/main/scala/kafka/javaapi/CreateTopicResult.scala PRE-CREATION 
>   core/src/main/scala/kafka/producer/BrokerPartitionInfo.scala 
> 13a8aa665016e19284c8ced35bac2195fe9e4378 
>   core/src/main/scala/kafka/producer/Producer.scala 
> cd634f653caa9090dc0046897fd5b138477fd5c0 
>   core/src/main/scala/kafka/producer/ProducerConfig.scala 
> 3cdf23dce3407f1770b9c6543e3a8ae8ab3ff255 
>   core/src/main/scala/kafka/producer/SyncProducer.scala 
> 489f0077512d9a69be81649c490274964290fa40 
>   core/src/main/scala/kafka/server/KafkaApis.scala 
> c584b559416b3ee4bcbec5966be4891e0a03eefb 
>   core/src/main/scala/kafka/server/KafkaConfig.scala 
> 1a45f8716ccc0398cf9395d91d66199d16882aae 
>   core/src/main/scala/kafka/tools/GetOffsetShell.scala 
> 9c6064e201eebbcd5b276a0dedd02937439edc94 
>   core/src/main/scala/kafka/tools/SimpleConsumerShell.scala 
> 36314f412a8281aece2789fd2b74a106b82c57d2 
>   core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala 
> 39f777baebb6c84fbfe84b91081ecafb43c01695 
>   core/src/test/scala/unit/kafka/api/RequestResponseSerializationTest.scala 
> cd16ced5465d098be7a60498326b2a98c248f343 
>   
> core/src/test/scala/unit/kafka/consumer/ZookeeperConsumerConnectorTest.scala 
> e1d87112a2a587aa3a2f5875f278b276c32f45ac 
>   core/src/test/scala/unit/kafka/integration/TopicMetadataTest.scala 
> 35dc071b1056e775326981573c9618d8046e601d 
>   core/src/test/scala/unit/kafka/producer/ProducerTest.scala 
> dd71d81041e1baa3e3ebdbc38f60f247ebd65948 
>   core/src/test/scala/unit/kafka/utils/TestUtils.scala 
> c4e13c5240c8303853d08cc3b40088f8c7dae460 
> 
> Diff: https://reviews.apache.org/r/24621/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Sriharsha Chintalapani
> 
>

Reply via email to