Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance HostProvider to update host provider on retryStart occurrence #107

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ChenHaoHu
Copy link

This pull request aims to enhance the functionality of the HostProvider by adding the hostProvider.UpdateServerList function. The goal is to update the host provider when the retryStart condition occurs twice.

During runtime, when the client is connecting to the ZooKeeper server, it is crucial to handle scenarios where the server undergoes a service restart. In such cases, the IP addresses of the ZooKeeper server may change, rendering the previously resolved IP addresses invalid. Currently, the client only selects an IP address from the initial resolution and does not perform subsequent DNS resolutions. As a result, the client continuously attempts to connect to an invalid IP.

In my specific case, we have a ZooKeeper deployment based on Kubernetes using a headless service. Consequently, when ZooKeeper restarts, the IP addresses can change, leading to connection issues.

By introducing the hostProvider.UpdateServerList function, we ensure that the host provider is updated when the retryStart condition occurs twice. This enables the client to handle changes in the ZooKeeper server's IP addresses effectively and avoid attempting connections to invalid IPs.

Overall, this enhancement addresses the issue of connection failures due to ZooKeeper service restarts and provides a more robust and reliable connection mechanism. The UpdateServerList function in the DNSHostProvider plays a vital role in re-resolving the previously configured domain name information, ensuring accurate and up-to-date IP address resolutions.

Your feedback and suggestions are greatly appreciated.

Thank you for your time and consideration.

Best regards,
ChenHaoHu

ChenHaoHu added 2 commits May 10, 2023 15:32
…dateServerList function to update the host provider when retryStart occurs twice
…dateServerList function to update the host provider when retryStart occurs twice
@ChenHaoHu
Copy link
Author

Copy link

@wenbingshen wenbingshen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants