Spider
Spider

Reputation: 1470

Cannot delete a Kafka topic in Windows

I have set the Zookeeper properties of "delete.topic.enable" to true. But I still cannot delete the topic. When I do mvn install or mvn test, I got following problems:

WARN Error processing kafka.log:type=LogManager,name=LogDirectoryOffline,logDirectory=C:\Users\extznq\AppData\Local\Temp\EH4Test7267133751803693562 (com.yammer.metrics.reporting.JmxReporter:397)
javax.management.MalformedObjectNameException: Invalid character ':' in value part of property

ERROR Error while deleting healthchecktopic1516638375589-0 in dir C:\Users\extznq\AppData\Local\Temp\EH4Test9083449671042580730. (kafka.server.LogDirFailureChannel:107)
        java.io.IOException: Failed to rename log directory from C:\Users\{My-topic-path} to C:\Users\{My-topic-path}-0.0a40ae7410c2401aba0816891789c334-delete
            at kafka.log.LogManager.asyncDelete(LogManager.scala:671)
            at kafka.cluster.Partition$$anonfun$delete$1.apply(Partition.scala:178)
            at kafka.cluster.Partition$$anonfun$delete$1.apply(Partition.scala:173)
            at kafka.utils.CoreUtils$.inLock(CoreUtils.scala:217)
            at kafka.utils.CoreUtils$.inWriteLock(CoreUtils.scala:225)
            at kafka.cluster.Partition.delete(Partition.scala:173)
            at kafka.server.ReplicaManager.stopReplica(ReplicaManager.scala:341)
            at kafka.server.ReplicaManager$$anonfun$stopReplicas$2.apply(ReplicaManager.scala:373)
            at kafka.server.ReplicaManager$$anonfun$stopReplicas$2.apply(ReplicaManager.scala:371)
            at scala.collection.Iterator$class.foreach(Iterator.scala:891)
            at scala.collection.AbstractIterator.foreach(Iterator.scala:1334)
            at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
            at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
            at kafka.server.ReplicaManager.stopReplicas(ReplicaManager.scala:371)
            at kafka.server.KafkaApis.handleStopReplicaRequest(KafkaApis.scala:190)
            at kafka.server.KafkaApis.handle(KafkaApis.scala:104)
            at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:65)
            at java.lang.Thread.run(Thread.java:745)

ERROR [Broker id=0] Ignoring stop replica (delete=true) for partition healthchecktopic1516728986980-0 due to storage exception (state.change.logger:107)
org.apache.kafka.common.errors.KafkaStorageException: Error while deleting healthchecktopic1516728986980-0 in dir C:\Users\AppData\Local\Temp\EH4Test7267133751803693562.
Caused by: java.io.IOException: Failed to rename log directory from C:\Users\AppData\Local\Temp\EH4Test7267133751803693562\healthchecktopic1516728986980-0 to C:\Users\AppData\Local\Temp\EH4Test7267133751803693562\healthchecktopic1516728986980-0.65fc6c32c44940e58c1a45bd2972523a-delete
    at kafka.log.LogManager.asyncDelete(LogManager.scala:671)

I think the Warning is all right. But I do not know why I would get errors, although I run the Eclipse as administrator. Especially, the KafkaStorageException, I still have 50GB in my computer.

Environment:

Upvotes: 4

Views: 2408

Answers (1)

Paizo
Paizo

Reputation: 4194

looks like you have an invalid character in the properties: Invalid character ':' in value part of property; also in the line below it seems that the placeholder you are using it is not replaced properly: C:\Users\{My-topic-path}

Furthermore there is an open issues related to file operation such as moving/delete in windows environment, I got the same problem upgrading from 0.10.2.1 to 1.1.0

This is the link to the issue: KAFKA-1194

Upvotes: 1

Related Questions