File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 11
11
ConnectionError , FailedPayloadsError ,
12
12
KafkaTimeoutError , KafkaUnavailableError ,
13
13
LeaderNotAvailableError , UnknownTopicOrPartitionError ,
14
- NotLeaderForPartitionError )
14
+ NotLeaderForPartitionError , ReplicaNotAvailableError )
15
15
16
16
from kafka .conn import collect_hosts , KafkaConnection , DEFAULT_SOCKET_TIMEOUT_SECONDS
17
17
from kafka .protocol import KafkaProtocol
@@ -350,6 +350,11 @@ def load_metadata_for_topics(self, *topics):
350
350
log .error ('No leader for topic %s partition %d' , topic , partition )
351
351
self .topics_to_brokers [topic_part ] = None
352
352
continue
353
+ # If one of the replicas is unavailable -- ignore
354
+ # this error code is provided for admin purposes only
355
+ # we never talk to replicas, only the leader
356
+ except ReplicaNotAvailableError :
357
+ log .warning ('Some (non-leader) replicas not available for topic %s partition %d' , topic , partition )
353
358
354
359
# If Known Broker, topic_partition -> BrokerMetadata
355
360
if leader in self .brokers :
You can’t perform that action at this time.
0 commit comments