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

[feat]curvefs: change hostname to optional #2574

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

201341
Copy link
Contributor

@201341 201341 commented Jun 27, 2023

What problem does this PR solve?

Issue Number: #2493

Problem Summary:

What is changed and how it works?

What's Changed:

How it Works:

Side effects(Breaking backward compatibility? Performance regression?):

Check List

  • Relevant documentation/comments is changed or added
  • I acknowledge that all my contributions will be made under the project's license

@201341
Copy link
Contributor Author

201341 commented Jun 27, 2023

cicheck

@201341 201341 requested a review from ilixiaocui June 29, 2023 09:21
@ilixiaocui ilixiaocui requested a review from SeanHai July 6, 2023 09:47
return -1;
LOG(INFO) << "get hostname failed!";
} else {
req.set_hostname(hostname);
Copy link
Contributor

Choose a reason for hiding this comment

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

You need change the hostName of MetaServerRegistRequest in topology.proto to optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@@ -628,7 +628,9 @@ int CurvefsBuildTopologyTool::CreateServer() {
for (auto it : serverDatas) {
ServerRegistRequest request;
ServerRegistResponse response;
request.set_hostname(it.name);
if (!it.name.empty()) {
request.set_hostname(it.name);
Copy link
Contributor

Choose a reason for hiding this comment

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

You need change hostName of ServerRegistRequest in topology.topo to optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@@ -125,7 +125,12 @@ void TopologyManager::RegistMetaServer(const MetaServerRegistRequest *request,
}
}

MetaServer metaserver(metaServerId, request->hostname(), token, serverId,
std::string hostname;
if (request->has_hostname()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

not need, request->hostname() is empty string if hostname not set.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@SeanHai
Copy link
Contributor

SeanHai commented Jul 6, 2023

  1. You should check all code that uses hostname to see if remove hostname affects it.
    For example:

    std::string TopologyImpl::GetHostNameAndPortById(MetaServerIdType msId) {

  2. You need add some unit test of you modified when not set hostname.

@ilixiaocui
Copy link
Contributor

  1. You should check all code that uses hostname to see if remove hostname affects it.
    For example:
    std::string TopologyImpl::GetHostNameAndPortById(MetaServerIdType msId) {
  2. You need add some unit test of you modified when not set hostname.

ditto

@@ -79,7 +79,7 @@ message ZoneData {

message ServerData {
required uint32 serverId = 1;
required string hostName = 2;
optional string hostName = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

Modify the part of curvebs accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I will change the curvebs code in another pr for passing ci.

Signed-off-by: swj <1186093704@qq.com>
@201341
Copy link
Contributor Author

201341 commented Jul 7, 2023

cicheck

@SeanHai
Copy link
Contributor

SeanHai commented Jul 13, 2023

  1. You should check all code that uses hostname to see if remove hostname affects it.
    For example:
    std::string TopologyImpl::GetHostNameAndPortById(MetaServerIdType msId) {
  2. You need add some unit test of you modified when not set hostname.

The modify of hostname is not only affect register, you need check other place used hostname like above example.

@201341
Copy link
Contributor Author

201341 commented Jul 14, 2023

  1. You should check all code that uses hostname to see if remove hostname affects it.
    For example:
    std::string TopologyImpl::GetHostNameAndPortById(MetaServerIdType msId) {
  2. You need add some unit test of you modified when not set hostname.

The modify of hostname is not only affect register, you need check other place used hostname like above example.

Yes, But I find no other codes that effect by hostname after searching keyword 'hostname'.

@SeanHai
Copy link
Contributor

SeanHai commented Jul 21, 2023

LGTM!

@ilixiaocui ilixiaocui merged commit c30eff0 into opencurve:master Jul 21, 2023
3 checks passed
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.

None yet

3 participants