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

ASF GitHub Bot commented on KAFKA-3415:
---------------------------------------

GitHub user edoardocomar opened a pull request:

    https://github.com/apache/kafka/pull/1089

    KAFKA-3415: Add partitions check if 0 partitions are to be added

    If no partitions are to be added, the command will exit gracefully with
    retcode 0 and a printed message.
    
    This patch was developed with @mimaison

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/edoardocomar/kafka KAFKA-3415

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/kafka/pull/1089.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1089
    
----
commit f73cd36fad1035a58819e467359706fdf090a128
Author: edoardo <eco...@uk.ibm.com>
Date:   2016-03-17T16:45:54Z

    KAFKA-3415: Add partitions check if 0 partitions are to be added
    
    If no partitions are to be added, the command will exit gracefully with
    retcode 0 and a printed message.
    
    This patch was developed with @mimaison

----


> AdminOperationException when altering Topic with same number of partitions
> --------------------------------------------------------------------------
>
>                 Key: KAFKA-3415
>                 URL: https://issues.apache.org/jira/browse/KAFKA-3415
>             Project: Kafka
>          Issue Type: Improvement
>          Components: admin
>    Affects Versions: 0.9.0.1
>            Reporter: GĂ©rald Quintana
>            Priority: Minor
>
> To automate topic creation/modification, we sometimes run kafka-topics.sh 
> script with the same topic config. It raises an AdminOperationException, in 
> short it's idempotent
> {code}
> bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic logfailed
> Topic:logfailed PartitionCount:1        ReplicationFactor:1     
> Configs:retention.ms=604800000,retention.bytes=209715200
>         Topic: logfailed        Partition: 0    Leader: 1       Replicas: 1   
>   Isr: 1
> bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic logfailed 
> --partitions 1 --config retention.bytes=209715200 --config 
> retention.ms=604800000
> WARNING: Altering topic configuration from this script has been deprecated 
> and may be removed in future releases.
>          Going forward, please use kafka-configs.sh for this functionality
> Updated config for topic "logfailed".
> WARNING: If partitions are increased for a topic that has a key, the 
> partition logic or ordering of the messages will be affected
> Error while executing topic command : The number of partitions for a topic 
> can only be increased
> [2016-03-17 12:25:20,458] ERROR kafka.admin.AdminOperationException: The 
> number of partitions for a topic can only be increased
>         at kafka.admin.AdminUtils$.addPartitions(AdminUtils.scala:119)
>         at 
> kafka.admin.TopicCommand$$anonfun$alterTopic$1.apply(TopicCommand.scala:139)
>         at 
> kafka.admin.TopicCommand$$anonfun$alterTopic$1.apply(TopicCommand.scala:116)
>         at 
> scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
>         at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
>         at kafka.admin.TopicCommand$.alterTopic(TopicCommand.scala:116)
>         at kafka.admin.TopicCommand$.main(TopicCommand.scala:62)
>         at kafka.admin.TopicCommand.main(TopicCommand.scala)
>  (kafka.admin.TopicCommand$)
> {code}



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

Reply via email to