Skip to content

Conversation

YongGoose
Copy link
Member

Ⅰ. 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

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>
@YongGoose
Copy link
Member Author

@funky-eyes

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.
With HTTP/1, I can process the result after receiving the response, whereas with HTTP/2, the result is handled via a callback.
I’m currently considering how to make the behavior consistent between the two.

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) {
Copy link
Member Author

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) {
Copy link
Member Author

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.

Comment on lines +478 to +481
if (selectedNode.isHttp2Supported()) {
Http2ClientUtil.doPost("http://" + tcAddress + "/metadata/v1/watch", param, header, CALLBACK);
return true; // TODO : Handle the response properly
}
Copy link
Member Author

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.

@YongGoose YongGoose requested a review from funky-eyes August 15, 2025 13:26
@funky-eyes
Copy link
Contributor

@funky-eyes

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. With HTTP/1, I can process the result after receiving the response, whereas with HTTP/2, the result is handled via a callback. I’m currently considering how to make the behavior consistent between the two.

If you have any suggestions for a good approach, Don't hesitate to tell me :)

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.

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.

Integrate Raft and Protocol Switching Based on Server Version
2 participants