-
Notifications
You must be signed in to change notification settings - Fork 8.9k
feature : Integrate Raft and Protocol Switching Based on Server Version #7586
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
base: 2.x
Are you sure you want to change the base?
Conversation
Signed-off-by: yongjunhong <yongjunh@apache.org>
Signed-off-by: yongjunhong <yongjunh@apache.org>
Signed-off-by: yongjunhong <yongjunh@apache.org>
Signed-off-by: yongjunhong <yongjunh@apache.org>
I first select the Node in order to determine whether to use HTTP/2 or HTTP/1, and then extract the address accordingly. There’s one decision point we need to address. If you have any suggestions for a good approach, Don't hesitate to tell me :) |
private static String queryHttpAddress(String clusterName, String group) { | ||
// 그러면 여기에서 string을 반환하는 것이 아니라 node를 반환해야 된다. (node를 반환해서 node의 버전에 따라 결정) | ||
// 또는 2.0이 가능한 node를 먼저 선택하게 하는 거는 어떨까? | ||
private static Node selectNodeForHttpAddress(String clusterName, String group) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is designed to select the node.
return null; | ||
} | ||
|
||
private static String queryHttpAddress(String clusterName, Node selectedNode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method extracts the HTTP address based on the selected node and the cluster name.
if (selectedNode.isHttp2Supported()) { | ||
Http2ClientUtil.doPost("http://" + tcAddress + "/metadata/v1/watch", param, header, CALLBACK); | ||
return true; // TODO : Handle the response properly | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So that HTTP/2 is used based on the node’s version.
I agree, because during initialization, the server-side API is called to obtain metadata about the members in the Raft group. At this point, it’s possible to retrieve the version number of each member, which can then be used for version switching as needed. |
Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?
fixes #7544
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews