Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #804 from Parsely/bugfix/missing_replica_update
Browse files Browse the repository at this point in the history
only add brokers to replicas set that the cluster is aware of
  • Loading branch information
Emmett J. Butler committed May 16, 2018
2 parents d1e3ee4 + ea094f3 commit 97c764a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pykafka/topic.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@ def update(self, metadata):
self._partitions[meta.id] = Partition(
self, meta.id,
brokers[meta.leader],
[brokers[b] for b in meta.replicas],
# only add replicas that the cluster is aware of to avoid
# KeyErrors here. inconsistencies will be automatically
# resolved when `Cluster.update` is called.
[brokers[b] for b in meta.replicas if b in brokers],
[brokers[b] for b in meta.isr],
)
else:
Expand Down

0 comments on commit 97c764a

Please sign in to comment.