主题是 MarkedForDeletion ,如何强制删除主题而不从磁盘和 Zookeeper 中积极删除主题

发布于 2025-01-09 04:57:34 字数 1653 浏览 1 评论 0原文

我们有kafka代理集群版本 - 2.7,我们有3个代理机器

我们通过以下cli删除了以下主题

bin/kafka-topics.sh --delete --zookeeper zoo01:2181 --topic my_first_car

1天后

我们仍然在kafka磁盘上看到主题,并且从以下命令

kafka-topics.sh --zookeeper zoo01:2181 --describe 
Topic: my_first_car   PartitionCount: 200     ReplicationFactor: 1    Configs: segment.bytes=1073741824,retention.bytes=7434770380    MarkedForDeletion: true
        Topic: my_first_car   Partition: 0    Leader: none    Replicas: 1001  Isr: 1001       MarkedForDeletion: true
        Topic: my_first_car   Partition: 1    Leader: none    Replicas: 1002  Isr: 1002       MarkedForDeletion: true
        Topic: my_first_car   Partition: 2    Leader: none    Replicas: 1003  Isr: 1003       MarkedForDeletion: true
        Topic: my_first_car   Partition: 3    Leader: none    Replicas: 1001  Isr: 1001       MarkedForDeletion: true
        Topic: my_first_car   Partition: 4    Leader: none    Replicas: 1002  Isr: 1002       MarkedForDeletion: true
        Topic: my_first_car   Partition: 5    Leader: none    Replicas: 1003  Isr: 1003       MarkedForDeletion: true
        Topic: my_first_car   Partition: 6    Leader: none    Replicas: 1001  Isr: 1001       MarkedForDeletion: true
        Topic: my_first_car   Partition: 7    Leader: none    Replicas: 1002  Isr: 1002       MarkedForDeletion: true
    

我们还注意到主题存在于zookeeper上/topics

因此,为了尝试完全删除这个主题,我们重新启动所有 Kafka 代理机器,但这没有帮助

删除该主题的下一步是什么 - my_first_car

很荒谬的是,Kafka 提供了 cli 来删除 topic,但实际上 topic 保留在 Kafka 磁盘上。

注意 - 我们最不想要的就是从磁盘和 Zookeeper 中删除 topic,但是这个是丑陋的方式

We have kafka broker cluster version - 2.7 , we have 3 brokers machines

We removed the following topic , by following cli

bin/kafka-topics.sh --delete --zookeeper zoo01:2181 --topic my_first_car

After 1 day

we still see the topics on kafka disk , and also from following command

kafka-topics.sh --zookeeper zoo01:2181 --describe 
Topic: my_first_car   PartitionCount: 200     ReplicationFactor: 1    Configs: segment.bytes=1073741824,retention.bytes=7434770380    MarkedForDeletion: true
        Topic: my_first_car   Partition: 0    Leader: none    Replicas: 1001  Isr: 1001       MarkedForDeletion: true
        Topic: my_first_car   Partition: 1    Leader: none    Replicas: 1002  Isr: 1002       MarkedForDeletion: true
        Topic: my_first_car   Partition: 2    Leader: none    Replicas: 1003  Isr: 1003       MarkedForDeletion: true
        Topic: my_first_car   Partition: 3    Leader: none    Replicas: 1001  Isr: 1001       MarkedForDeletion: true
        Topic: my_first_car   Partition: 4    Leader: none    Replicas: 1002  Isr: 1002       MarkedForDeletion: true
        Topic: my_first_car   Partition: 5    Leader: none    Replicas: 1003  Isr: 1003       MarkedForDeletion: true
        Topic: my_first_car   Partition: 6    Leader: none    Replicas: 1001  Isr: 1001       MarkedForDeletion: true
        Topic: my_first_car   Partition: 7    Leader: none    Replicas: 1002  Isr: 1002       MarkedForDeletion: true
    

We also notice that topics is exist on zookeeper under /topics

So in order to try to complete delete this topic we restart all Kafka broker machines , but this isn't help

What are the next steps to delete the topic - my_first_car

It is ridiculous , that Kafka provide cli to delete topic , but actually topic stay on Kafka disk

Note - the last thing that we want is to delete the topic from the disks and from the zookeeper , but this is the ugly way

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

隱形的亼 2025-01-16 04:57:34

问题似乎是领导者:无。不确定 ISR 列表如何更新为有效值,但 Zookeeper 和 Controller 节点之间似乎存在一些损坏,导致 Leader 未知,因此无法解析主题数据以将其删除。

The issue appears to be Leader: none. Not sure how the ISR list is updated with valid values, but there seems to be some corruption between Zookeeper and the Controller node such that the Leader is unknown, so the topic data cannot be resolved in order to be deleted.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文