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

raft模式客户端使用域名时,发生访问端口错误 #6551

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

Conversation

zacharias1989
Copy link

Ⅰ. 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中重复解析。

@zacharias1989
Copy link
Author

已在queryHttpAddress方法中解析了node,统一使用IP,无论使用IP还是域名都可以正确运行

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

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

LGTM

@funky-eyes funky-eyes added this to the 2.x Backlog milestone May 16, 2024
@funky-eyes funky-eyes added first-time contributor first-time contributor module/discovery discovery module type: bug Category issues or prs related to bug. labels May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-time contributor first-time contributor module/discovery discovery module type: bug Category issues or prs related to bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

使用2.0.0的raft模式集群,客户端的RM和TM连接成功后一直报Decode frame error
3 participants