How to decrease the number of partitions?

Solution Verified - Updated -

Issue

  • How to decrease the number of partitions?
  • "2396093: Failure processing KafkaTopic watch event MODIFIED on resource my-topic with labels {strimzi.io/cluster=my-cluster}: Number of partitions cannot be decreased" error occurs
[2020-12-25 05:03:52,505] INFO  <TopicWatcher:43> [2.25.0.1/...] 32|kube =my-topic|2396093: event MODIFIED on resource my-topic generation=3, labels={strimzi.io/cluster=my-cluster}
[2020-12-25 05:03:52,548] INFO  <opicOperator:536> [oop-thread-0] 32|kube =my-topic|2396093: Reconciling topic my-topic, k8sTopic:nonnull, kafkaTopic:nonnull, privateTopic:nonnull
[2020-12-25 05:03:52,549] ERROR <opicOperator:691> [oop-thread-0] 32|kube =my-topic|2396093: Number of partitions cannot be decreased
[2020-12-25 05:03:52,590] INFO  <opicOperator:120> [oop-thread-0] Number of partitions cannot be decreased
[2020-12-25 05:03:52,600] INFO  <TopicWatcher:43> [2.25.0.1/...] 33|kube =my-topic|2396095: event MODIFIED on resource my-topic generation=3, labels={strimzi.io/cluster=my-cluster}
[2020-12-25 05:03:52,612] ERROR <TopicWatcher:56> [oop-thread-0] 32|kube =my-topic|2396093: Failure processing KafkaTopic watch event MODIFIED on resource my-topic with labels {strimzi.io/cluster=my-cluster}: Number of partitions cannot be decreased
io.strimzi.operator.topic.PartitionDecreaseException: Number of partitions cannot be decreased
     at io.strimzi.operator.topic.TopicOperator.update3Way(TopicOperator.java:694) ~[io.strimzi.topic-operator-0.20.0.redhat-00003.jar:0.20.0.redhat-00003]
     at io.strimzi.operator.topic.TopicOperator.reconcile(TopicOperator.java:597) ~[io.strimzi.topic-operator-0.20.0.redhat-00003.jar:0.20.0.redhat-00003]
     at io.strimzi.operator.topic.TopicOperator.lambda$reconcileOnResourceChange$24(TopicOperator.java:1062) ~[io.strimzi.topic-operator-0.20.0.redhat-00003.jar:0.20.0.redhat-00003]
     at io.vertx.core.Future.lambda$compose$3(Future.java:368) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.FutureImpl.dispatch(FutureImpl.java:105) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.FutureImpl.tryComplete(FutureImpl.java:150) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.FutureImpl.complete(FutureImpl.java:111) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.FutureImpl.handle(FutureImpl.java:176) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.CompositeFutureImpl.doComplete(CompositeFutureImpl.java:252) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.CompositeFutureImpl.tryComplete(CompositeFutureImpl.java:227) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.CompositeFutureImpl.tryComplete(CompositeFutureImpl.java:232) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.CompositeFutureImpl.complete(CompositeFutureImpl.java:199) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.CompositeFutureImpl.lambda$all$0(CompositeFutureImpl.java:39) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.FutureImpl.dispatch(FutureImpl.java:105) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.FutureImpl.tryComplete(FutureImpl.java:150) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.FutureImpl.complete(FutureImpl.java:111) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.Future.lambda$map$4(Future.java:416) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.FutureImpl.dispatch(FutureImpl.java:105) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.FutureImpl.tryComplete(FutureImpl.java:150) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.FutureImpl.complete(FutureImpl.java:111) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.Future.lambda$recover$6(Future.java:495) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.FutureImpl.dispatch(FutureImpl.java:105) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.FutureImpl.tryComplete(FutureImpl.java:150) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.FutureImpl.complete(FutureImpl.java:111) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.Future.lambda$map$4(Future.java:416) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.FutureImpl.dispatch(FutureImpl.java:105) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.FutureImpl.tryComplete(FutureImpl.java:150) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.FutureImpl.complete(FutureImpl.java:111) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.FutureImpl.handle(FutureImpl.java:176) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.CompositeFutureImpl.doComplete(CompositeFutureImpl.java:252) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.CompositeFutureImpl.tryComplete(CompositeFutureImpl.java:227) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.CompositeFutureImpl.tryComplete(CompositeFutureImpl.java:232) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.CompositeFutureImpl.complete(CompositeFutureImpl.java:199) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.CompositeFutureImpl.lambda$all$0(CompositeFutureImpl.java:39) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.FutureImpl.dispatch(FutureImpl.java:105) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.FutureImpl.tryComplete(FutureImpl.java:150) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.FutureImpl.complete(FutureImpl.java:111) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.strimzi.operator.topic.KafkaImpl.lambda$mapFuture$7(KafkaImpl.java:168) ~[io.strimzi.topic-operator-0.20.0.redhat-00003.jar:0.20.0.redhat-00003]
     at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:366) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.vertx.core.impl.EventLoopContext.lambda$executeAsync$0(EventLoopContext.java:38) ~[io.vertx.vertx-core-3.9.4.redhat-00001.jar:3.9.4.redhat-00001]
     at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) [io.netty.netty-common-4.1.50.Final-redhat-00001.jar:4.1.50.Final-redhat-00001]
     at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472) [io.netty.netty-common-4.1.50.Final-redhat-00001.jar:4.1.50.Final-redhat-00001]
     at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) [io.netty.netty-transport-4.1.50.Final-redhat-00001.jar:4.1.50.Final-redhat-00001]
     at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) [io.netty.netty-common-4.1.50.Final-redhat-00001.jar:4.1.50.Final-redhat-00001]
     at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [io.netty.netty-common-4.1.50.Final-redhat-00001.jar:4.1.50.Final-redhat-00001]
     at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [io.netty.netty-common-4.1.50.Final-redhat-00001.jar:4.1.50.Final-redhat-00001]
     at java.lang.Thread.run(Thread.java:834) [?:?]

Environment

  • Red Hat AMQ Streams 1.6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content