diff --git a/lib/poseidon/topic_metadata.rb b/lib/poseidon/topic_metadata.rb index 3265c4b..61730aa 100644 --- a/lib/poseidon/topic_metadata.rb +++ b/lib/poseidon/topic_metadata.rb @@ -18,7 +18,7 @@ def initialize(struct=nil) end # Write a binary representation of the TopicMetadata to buffer - # + # # @param [RequestBuffer] buffer # @return [nil] def write(buffer) @@ -56,7 +56,7 @@ def partition_count def available_partitions @available_partitions ||= struct.partitions.select do |partition| - partition.error == 0 && partition.leader != -1 + (partition.error == Errors::NO_ERROR_CODE || Errors::ERROR_CODES[partition.error] == Errors::ReplicaNotAvailable) && partition.leader != -1 end end