Getting java.lang.IllegalStateException: Invalid partition count on topic

12 views
Skip to first unread message

Guillermo Cruz

unread,
Jun 15, 2020, 6:06:07 AM6/15/20
to ksqldb-users
I am getting the error below when I start up "image: confluentinc/ksqldb-server". The thing is we decided to put all future topics at 5 partitions as is in our server.properties file (num.partitions=5) So when I spin up initially a ksqldb-server instance all is fine but the moment I run my .sql file all Topics are created with 5 partitions. Then I go to another machine and start a ksqldb-server instance with the same "KSQL_KSQL_SERVICE_ID" trying to add it to the cluster and I get the error.

Any help would be appreciated.


[2020-06-15 08:25:35,049] ERROR Unhandled exception in server startup (io.confluent.ksql.rest.server.KsqlServerMain:76)
java.lang.IllegalStateException: Invalid partition count on topic '_confluent-ksql-ksqldb_my_command_topic'. Expected: 1, but was: 5
        at io.confluent.ksql.rest.util.KsqlInternalTopicUtils.validateTopicConfig(KsqlInternalTopicUtils.java:101)
        at io.confluent.ksql.rest.util.KsqlInternalTopicUtils.ensureTopic(KsqlInternalTopicUtils.java:64)
        at io.confluent.ksql.rest.server.KsqlRestApplication.registerCommandTopic(KsqlRestApplication.java:797)
        at io.confluent.ksql.rest.server.KsqlRestApplication.initialize(KsqlRestApplication.java:405)
        at io.confluent.ksql.rest.server.KsqlRestApplication.startKsql(KsqlRestApplication.java:344)
        at io.confluent.ksql.rest.server.KsqlRestApplication.startAsync(KsqlRestApplication.java:327)
        at io.confluent.ksql.rest.server.KsqlServerMain.tryStartApp(KsqlServerMain.java:72)
        at io.confluent.ksql.rest.server.KsqlServerMain.main(KsqlServerMain.java:58)
[2020-06-15 08:25:35,052] INFO Server shutting down (io.confluent.ksql.rest.server.KsqlServerMain:79)


BTW: you cant decrease partitions, I thought let me do it to all the created topics but did not work.  
    [2020-06-15 12:00:50,131] ERROR org.apache.kafka.common.errors.InvalidPartitionsException: The number of partitions for a topic can only be increased. Topic MSG_SHOWN_TABLE currently has 5 partitions, 1 would not be an increase.

Guillermo Cruz

unread,
Jun 15, 2020, 7:19:34 AM6/15/20
to ksqldb-users

Well I got past this issue by making sure that my Initial query has the same number of partitions as the Topic that it reads (PARTITIONS=5 in the WITH CLAUSE), mind you I had to delete all topics created by my .sql file and start from scratch.
Reply all
Reply to author
Forward
0 new messages