[ 
https://issues.apache.org/jira/browse/KAFKA-7755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16811736#comment-16811736
 ] 

Tim Bain commented on KAFKA-7755:
---------------------------------

(U) Is there anything about this issue and its fix that makes it specific to 
only Kubernetes? Or would this issue, and this fix, be applicable in any 
environment where the IP addresses backing the DNS hostname for brokers changes 
over time? Would this be expected to apply equally to an AWS environment where 
a DNS hostname such as broker1 in Route 53 is updated to point to a 
newly-launched EC2 instance when the previous EC2 instance died due to hardware 
failure?

> Kubernetes - Kafka clients are resolving DNS entries only one time
> ------------------------------------------------------------------
>
>                 Key: KAFKA-7755
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7755
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients
>    Affects Versions: 2.1.0
>         Environment: Kubernetes
>            Reporter: Loïc Monney
>            Priority: Blocker
>             Fix For: 2.2.0, 2.1.1
>
>         Attachments: pom.xml
>
>
> *Introduction*
>  Since 2.1.0 Kafka clients are supporting multiple DNS resolved IP addresses 
> if the first one fails. This change has been introduced by 
> https://issues.apache.org/jira/browse/KAFKA-6863. However this DNS resolution 
> is now performed only one time by the clients. This is not a problem if all 
> brokers have fixed IP addresses, however this is definitely an issue when 
> Kafka brokers are run on top of Kubernetes. Indeed, new Kubernetes pods will 
> receive another IP address, so as soon as all brokers will have been 
> restarted clients won't be able to reconnect to any broker.
> *Impact*
>  Everyone running Kafka 2.1 or later on top of Kubernetes is impacted when a 
> rolling restart is performed.
> *Root cause*
>  Since https://issues.apache.org/jira/browse/KAFKA-6863 Kafka clients are 
> resolving DNS entries only once.
> *Proposed solution*
>  In 
> [https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/ClusterConnectionStates.java#L368]
>  Kafka clients should perform the DNS resolution again when all IP addresses 
> have been "used" (when _index_ is back to 0)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to