Open magicsilence opened 2 years ago
Can you provide the complete broker log? And I have one question. Is the NOT_LEADER_FOR_PARTITION
always happening and can't be recoverable?
hi @Demogorgon314 .
I tired restarting all brokers and it stiil not work , the promblem is always happening.
I changed kop config entryFormat
from kafka
to mixed_kafka
for testing , will this action cause the problem?
producer : [duola@aws-ir1-bigdata-kafka-binlog-prod-020027 kafka_2.12-2.0.0]$ ./bin/kafka-console-producer.sh --broker-list 172.30.23.153:9092,172.30.24.142:9092,172.30.30.148:9092 --topic test_4
1[2022-08-08 07:18:15,987] WARN [Producer clientId=console-producer] Got error produce response with correlation id 5 on topic-partition test_4-0, retrying (2 attempts left). Error: NOT_LEADER_FOR_PARTITION (org.apache.kafka.clients.producer.internals.Sender) [2022-08-08 07:18:15,987] WARN [Producer clientId=console-producer] Received invalid metadata error in produce request on partition test_4-0 due to org.apache.kafka.common.errors.NotLeaderForPartitionException: This server is not the leader for that topic-partition.. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender)
[2022-08-08 07:18:16,089] WARN [Producer clientId=console-producer] Got error produce response with correlation id 7 on topic-partition test_4-0, retrying (1 attempts left). Error: NOT_LEADER_FOR_PARTITION (org.apache.kafka.clients.producer.internals.Sender) [2022-08-08 07:18:16,089] WARN [Producer clientId=console-producer] Received invalid metadata error in produce request on partition test_4-0 due to org.apache.kafka.common.errors.NotLeaderForPartitionException: This server is not the leader for that topic-partition.. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender) [2022-08-08 07:18:16,194] WARN [Producer clientId=console-producer] Got error produce response with correlation id 9 on topic-partition test_4-0, retrying (0 attempts left). Error: NOT_LEADER_FOR_PARTITION (org.apache.kafka.clients.producer.internals.Sender) [2022-08-08 07:18:16,194] WARN [Producer clientId=console-producer] Received invalid metadata error in produce request on partition test_4-0 due to org.apache.kafka.common.errors.NotLeaderForPartitionException: This server is not the leader for that topic-partition.. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender) [2022-08-08 07:18:16,300] ERROR Error when sending message to topic test_4 with key: null, value: 0 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback) org.apache.kafka.common.errors.NotLeaderForPartitionException: This server is not the leader for that topic-partition. [2022-08-08 07:18:16,303] WARN [Producer clientId=console-producer] Received invalid metadata error in produce request on partition test_4-0 due to org.apache.kafka.common.errors.NotLeaderForPartitionException: This server is not the leader for that topic-partition.. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender) [2022-08-08 07:18:17,080] WARN [Producer clientId=console-producer] Got error produce response with correlation id 13 on topic-partition test_4-0, retrying (2 attempts left). Error: NOT_LEADER_FOR_PARTITION (org.apache.kafka.clients.producer.internals.Sender) [2022-08-08 07:18:17,080] WARN [Producer clientId=console-producer] Received invalid metadata error in produce request on partition test_4-0 due to org.apache.kafka.common.errors.NotLeaderForPartitionException: This server is not the leader for that topic-partition.. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender) [2022-08-08 07:18:17,185] WARN [Producer clientId=console-producer] Got error produce response with correlation id 15 on topic-partition test_4-0, retrying (1 attempts left). Error: NOT_LEADER_FOR_PARTITION (org.apache.kafka.clients.producer.internals.Sender) [2022-08-08 07:18:17,185] WARN [Producer clientId=console-producer] Received invalid metadata error in produce request on partition test_4-0 due to org.apache.kafka.common.errors.NotLeaderForPartitionException: This server is not the leader for that topic-partition.. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender) [2022-08-08 07:18:17,289] WARN [Producer clientId=console-producer] Got error produce response with correlation id 17 on topic-partition test_4-0, retrying (0 attempts left). Error: NOT_LEADER_FOR_PARTITION (org.apache.kafka.clients.producer.internals.Sender) [2022-08-08 07:18:17,289] WARN [Producer clientId=console-producer] Received invalid metadata error in produce request on partition test_4-0 due to org.apache.kafka.common.errors.NotLeaderForPartitionException: This server is not the leader for that topic-partition.. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender) [2022-08-08 07:18:17,392] ERROR Error when sending message to topic test_4 with key: null, value: 1 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback) org.apache.kafka.common.errors.NotLeaderForPartitionException: This server is not the leader for that topic-partition. [2022-08-08 07:18:17,392] WARN [Producer clientId=console-producer] Received invalid metadata error in produce request on partition test_4-0 due to org.apache.kafka.common.errors.NotLeaderForPartitionException: This server is not the leader for that topic-partition.. Going to request metadata update now (org.apache.kafka.clients.producer.internals.Sender)
broker logs:
2022-08-08T07:18:14,725+0000 [pulsar-io-4-3] INFO org.apache.pulsar.broker.service.ServerCnx - New connection from /172.30.30.148:42692 2022-08-08T07:18:14,748+0000 [pulsar-web-36-8] INFO org.eclipse.jetty.server.RequestLog - 172.30.23.153 - - [08/Aug/2022:07:18:14 +0000] "GET /admin/v2/persistent/public/functions/coordinate/stats?getPreciseBacklog=false&subscriptionBacklogSize=false&getEarliestTimeInBacklog=false HTTP/1.1" 200 3350 "-" "Pulsar-Java-v2.10.1" 5 2022-08-08T07:18:14,776+0000 [pulsar-web-36-8] INFO org.eclipse.jetty.server.RequestLog - 172.30.23.153 - - [08/Aug/2022:07:18:14 +0000] "GET /admin/v2/persistent/public/functions/coordinate/stats?getPreciseBacklog=false&subscriptionBacklogSize=false&getEarliestTimeInBacklog=false HTTP/1.1" 200 3350 "-" "Pulsar-Java-v2.10.1" 6 2022-08-08T07:18:14,809+0000 [pulsar-2-1] INFO org.apache.pulsar.broker.loadbalance.impl.ModularLoadManagerImpl - 3 brokers being considered for assignment of public/default/0xe0000000_0xf0000000 2022-08-08T07:18:15,976+0000 [pulsar-ph-kafka-59-2] WARN org.apache.pulsar.broker.service.BrokerService - Namespace bundle for topic (persistent://public/default/test_4-partition-0) not served by this instance. Please redo the lookup. Request is denied: namespace=public/default 2022-08-08T07:18:15,977+0000 [pulsar-ph-kafka-59-2] WARN org.apache.pulsar.broker.service.BrokerService - Namespace bundle for topic (persistent://public/default/test_4) not served by this instance. Please redo the lookup. Request is denied: namespace=public/default 2022-08-08T07:18:16,009+0000 [pulsar-web-36-8] INFO org.eclipse.jetty.server.RequestLog - 172.30.23.153 - - [08/Aug/2022:07:18:16 +0000] "GET /admin/v2/persistent/public/default/test_4/partitions HTTP/1.1" 200 16 "-" "Pulsar-Java-v2.10.1" 5 2022-08-08T07:18:16,020+0000 [pulsar-client-io-41-1] INFO org.apache.pulsar.client.impl.ConnectionPool - [[id: 0x01eba0ea, L:/172.30.23.153:34728 - R:172.30.23.153/172.30.23.153:6650]] Connected to server 2022-08-08T07:18:16,022+0000 [pulsar-io-4-2] INFO org.apache.pulsar.broker.service.ServerCnx - New connection from /172.30.23.153:34728 2022-08-08T07:18:16,087+0000 [pulsar-ph-kafka-59-2] WARN org.apache.pulsar.broker.service.BrokerService - Namespace bundle for topic (persistent://public/default/test_4-partition-0) not served by this instance. Please redo the lookup. Request is denied: namespace=public/default 2022-08-08T07:18:16,087+0000 [pulsar-ph-kafka-59-2] WARN org.apache.pulsar.broker.service.BrokerService - Namespace bundle for topic (persistent://public/default/test_4) not served by this instance. Please redo the lookup. Request is denied: namespace=public/default 2022-08-08T07:18:16,136+0000 [pulsar-web-36-1] INFO org.eclipse.jetty.server.RequestLog - 172.30.23.153 - - [08/Aug/2022:07:18:16 +0000] "GET /admin/v2/persistent/public/default/test_4/partitions HTTP/1.1" 200 16 "-" "Pulsar-Java-v2.10.1" 3 2022-08-08T07:18:16,189+0000 [pulsar-ph-kafka-59-2] WARN org.apache.pulsar.broker.service.BrokerService - Namespace bundle for topic (persistent://public/default/test_4-partition-0) not served by this instance. Please redo the lookup. Request is denied: namespace=public/default 2022-08-08T07:18:16,190+0000 [pulsar-ph-kafka-59-2] WARN org.apache.pulsar.broker.service.BrokerService - Namespace bundle for topic (persistent://public/default/test_4) not served by this instance. Please redo the lookup. Request is denied: namespace=public/default 2022-08-08T07:18:16,248+0000 [pulsar-web-36-5] INFO org.eclipse.jetty.server.RequestLog - 172.30.23.153 - - [08/Aug/2022:07:18:16 +0000] "GET /admin/v2/persistent/public/default/test_4/partitions HTTP/1.1" 200 16 "-" "Pulsar-Java-v2.10.1" 4 2022-08-08T07:18:16,297+0000 [pulsar-ph-kafka-59-2] WARN org.apache.pulsar.broker.service.BrokerService - Namespace bundle for topic (persistent://public/default/test_4-partition-0) not served by this instance. Please redo the lookup. Request is denied: namespace=public/default 2022-08-08T07:18:16,297+0000 [pulsar-ph-kafka-59-2] WARN org.apache.pulsar.broker.service.BrokerService - Namespace bundle for topic (persistent://public/default/test_4) not served by this instance. Please redo the lookup. Request is denied: namespace=public/default 2022-08-08T07:18:16,359+0000 [pulsar-web-36-6] INFO org.eclipse.jetty.server.RequestLog - 172.30.23.153 - - [08/Aug/2022:07:18:16 +0000] "GET /admin/v2/persistent/public/default/test_4/partitions HTTP/1.1" 200 16 "-" "Pulsar-Java-v2.10.1" 3 2022-08-08T07:18:17,078+0000 [pulsar-ph-kafka-59-2] WARN org.apache.pulsar.broker.service.BrokerService - Namespace bundle for topic (persistent://public/default/test_4-partition-0) not served by this instance. Please redo the lookup. Request is denied: namespace=public/default 2022-08-08T07:18:17,079+0000 [pulsar-ph-kafka-59-2] WARN org.apache.pulsar.broker.service.BrokerService - Namespace bundle for topic (persistent://public/default/test_4) not served by this instance. Please redo the lookup. Request is denied: namespace=public/default 2022-08-08T07:18:17,090+0000 [pulsar-web-36-6] INFO org.eclipse.jetty.server.RequestLog - 172.30.23.153 - - [08/Aug/2022:07:18:17 +0000] "GET /admin/v2/persistent/public/default/test_4/partitions HTTP/1.1" 200 16 "-" "Pulsar-Java-v2.10.1" 6 2022-08-08T07:18:17,184+0000 [pulsar-ph-kafka-59-2] WARN org.apache.pulsar.broker.service.BrokerService - Namespace bundle for topic (persistent://public/default/test_4-partition-0) not served by this instance. Please redo the lookup. Request is denied: namespace=public/default 2022-08-08T07:18:17,184+0000 [pulsar-ph-kafka-59-2] WARN org.apache.pulsar.broker.service.BrokerService - Namespace bundle for topic (persistent://public/default/test_4) not served by this instance. Please redo the lookup. Request is denied: namespace=public/default 2022-08-08T07:18:17,206+0000 [pulsar-web-36-4] INFO org.eclipse.jetty.server.RequestLog - 172.30.23.153 - - [08/Aug/2022:07:18:17 +0000] "GET /admin/v2/persistent/public/default/test_4/partitions HTTP/1.1" 200 16 "-" "Pulsar-Java-v2.10.1" 6 2022-08-08T07:18:17,286+0000 [pulsar-ph-kafka-59-2] WARN org.apache.pulsar.broker.service.BrokerService - Namespace bundle for topic (persistent://public/default/test_4-partition-0) not served by this instance. Please redo the lookup. Request is denied: namespace=public/default 2022-08-08T07:18:17,287+0000 [pulsar-ph-kafka-59-2] WARN org.apache.pulsar.broker.service.BrokerService - Namespace bundle for topic (persistent://public/default/test_4) not served by this instance. Please redo the lookup. Request is denied: namespace=public/default 2022-08-08T07:18:17,337+0000 [pulsar-web-36-7] INFO org.eclipse.jetty.server.RequestLog - 172.30.23.153 - - [08/Aug/2022:07:18:17 +0000] "GET /admin/v2/persistent/public/default/test_4/partitions HTTP/1.1" 200 16 "-" "Pulsar-Java-v2.10.1" 7 2022-08-08T07:18:17,391+0000 [pulsar-ph-kafka-59-2] WARN org.apache.pulsar.broker.service.BrokerService - Namespace bundle for topic (persistent://public/default/test_4-partition-0) not served by this instance. Please redo the lookup. Request is denied: namespace=public/default 2022-08-08T07:18:17,391+0000 [pulsar-ph-kafka-59-2] WARN org.apache.pulsar.broker.service.BrokerService - Namespace bundle for topic (persistent://public/default/test_4) not served by this instance. Please redo the lookup. Request is denied: namespace=public/default
Can you provide each broker's configuration? Or you can check the kafkaAdvertisedListeners
and kafkaListeners
settings in each broker, here is an example setting:
broker-01
kafkaListeners=PLAINTEXT://pulsar-broker-01-ip:9092
kafkaAdvertisedListeners=PLAINTEXT://pulsar-broker-01-ip:9092
broker-02
kafkaListeners=PLAINTEXT://pulsar-broker-02-ip:9092
kafkaAdvertisedListeners=PLAINTEXT://pulsar-broker-02-ip:9092
@Demogorgon314
broker-01(172.30.23.153)
kafkaListeners=PLAINTEXT://0.0.0.0:9092
kafkaAdvertisedListeners=PLAINTEXT://172.30.23.153:9092
broker-02(172.30.24.142)
kafkaListeners=PLAINTEXT://0.0.0.0:9092
kafkaAdvertisedListeners=PLAINTEXT://172.30.24.142:9092
broker-03(172.30.30.148)
kafkaListeners=PLAINTEXT://0.0.0.0:9092
kafkaAdvertisedListeners=PLAINTEXT://172.30.30.148:9092
@magicsilence The configuration look's good to me. Can you provide full broker logs? The debug level log is better.
hi, I also face the same problem. I deleted the topic using pulsar CLI after that I wanted to create same topic by just connecting producer, and sending message to the same topic via kafka CLI. This might help you in reproducing the problem. My question is if it is possible to find a work around for using the same topic again?
@oguzhantortop Thanks for providing the reproducing step! I'll try it later.
@oguzhantortop Thanks for providing the reproducing step! I'll try it later.
Sorry I figured out that when I use KOP it creates a partitioned topic. And from pulsar-admin CLI I deleted topic using topics delete instead of delete-partitioned-topic command. Maybe delete shouldn't delete partitioned topic or maybe it is a design choice it let's you to delete a single partition of topic. Anyway after deleting topic with delete-partitioned-topic command I was able to produce from KAFKA CLI. But this still let's you to reproduce the problem.
Env
Describe the bug
I got a warn msg when using kafka-console-producer.sh write data to pulsar.
./bin/kafka-console-producer.sh --broker-list A.A.A.A:9092,B.B.B.B:9092,C.C.C.:9092 --topic test_4
At the same time, pulsar-broker.log got some logs, like
And Pulsar broker config:
Additional context The pulsar client can produce/consume normally in this cluster.