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.
Ⅰ. Describe what this PR did
raft模式,客户端watch集群时,会使用解析后的IP地址查询raft节点。
如果客户端配置中使用域名,则无法用IP找到节点,导致获取http端口号错误。
这里修改为使用域名。
修改后,如果环境中存在DNS(如在k8s等环境中),需要优先使用域名,否则仍会出现匹配问题。
建议后续修改METADATA的数据结构,保存DNS解析结果,避免在queryHttpAddress中重复解析node地址。
Ⅱ. Does this pull request fix one issue?
fixes #6532
Ⅲ. Why don't you add test cases (unit test/integration test)?
修改内容较少,如果环境中不存在DNS,不造成任何影响
Ⅳ. Describe how to verify it
在k8s环境中直接使用集群内部域名时,个人已验证
Ⅴ. Special notes for reviews
由于METADATA中只记录了原始节点信息,不区分域名或IP,所以无法确保比较结果。
如果直接在queryHttpAddress解析原始节点信息会造成不必要的网络压力和性能损失。
要彻底修复该问题,建议修改METADATA中的节点信息,解析并保存DNS解析结果,避免在queryHttpAddress中重复解析。