Enhance HostProvider to update host provider on retryStart occurrence #107
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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