1
resposta

Erro ao Deletar Topic Kafka Windows 10

Sera que alguem poderia ajudar a resolver o erro abaixo para deletar um Topic, mesmo com o comando "delete.topic.enable=true" no server.properties adicionado ainda apresenta erro:

[2020-10-16 00:05:34,413] ERROR Error while renaming dir for TestTopic-0 in log dir C:\tmp\kafka-logs (kafka.server.LogDirFailureChannel)
java.nio.file.AccessDeniedException: C:\tmp\kafka-logs\TestTopic-0 -> C:\tmp\kafka-logs\TestTopic-0.22b6a93603dc47289a0df94d0d0bb798-delete
        at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
        at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
        at sun.nio.fs.WindowsFileCopy.move(Unknown Source)
        at sun.nio.fs.WindowsFileSystemProvider.move(Unknown Source)
        at java.nio.file.Files.move(Unknown Source)
        at org.apache.kafka.common.utils.Utils.atomicMoveWithFallback(Utils.java:913)
        at kafka.log.Log.$anonfun$renameDir$2(Log.scala:981)
        at kafka.log.Log.renameDir(Log.scala:2340)
        at kafka.log.LogManager.asyncDelete(LogManager.scala:935)
        at kafka.cluster.Partition.$anonfun$delete$1(Partition.scala:470)
        at kafka.cluster.Partition.delete(Partition.scala:461)
        at kafka.server.ReplicaManager.stopReplica(ReplicaManager.scala:344)
        at kafka.server.ReplicaManager.$anonfun$stopReplicas$9(ReplicaManager.scala:448)
        at scala.collection.mutable.HashMap$Node.foreach(HashMap.scala:587)
        at scala.collection.mutable.HashMap.foreach(HashMap.scala:475)
        at kafka.server.ReplicaManager.stopReplicas(ReplicaManager.scala:445)
        at kafka.server.KafkaApis.handleStopReplicaRequest(KafkaApis.scala:252)
        at kafka.server.KafkaApis.handle(KafkaApis.scala:137)
        at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:70)
        at java.lang.Thread.run(Unknown Source)
        Suppressed: java.nio.file.AccessDeniedException: C:\tmp\kafka-logs\TestTopic-0 -> C:\tmp\kafka-logs\TestTopic-0.22b6a93603dc47289a0df94d0d0bb798-delete
                at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
                at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
                at sun.nio.fs.WindowsFileCopy.move(Unknown Source)
                at sun.nio.fs.WindowsFileSystemProvider.move(Unknown Source)
                at java.nio.file.Files.move(Unknown Source)
                at org.apache.kafka.common.utils.Utils.atomicMoveWithFallback(Utils.java:910)
                ... 14 more
[2020-10-16 00:05:34,416] WARN [ReplicaManager broker=0] Stopping serving replicas in dir C:\tmp\kafka-logs (kafka.server.ReplicaManager)
[2020-10-16 00:05:34,421] WARN [ReplicaManager broker=0] Broker 0 stopped fetcher for partitions  and stopped moving logs for partitions  because they are in the failed log directory C:\tmp\kafka-logs. (kafka.server.ReplicaManager)
[2020-10-16 00:05:34,422] WARN Stopping serving logs in dir C:\tmp\kafka-logs (kafka.log.LogManager)
[2020-10-16 00:05:34,428] ERROR Shutdown broker because all log dirs in C:\tmp\kafka-logs have failed (kafka.log.LogManager)
1 resposta

Dando uma pesquisada parece bug no Kafka para Windows: https://issues.apache.org/jira/browse/KAFKA-1194

Uma solução paleativa que recomendam é ir ao local do tópico e excluí-lo manualmente: /tmp/kafka-logs/[yourTopicName]