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: merge two rpc into one when delete #2744

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

201341
Copy link
Contributor

@201341 201341 commented Sep 12, 2023

What problem does this PR solve?

Issue Number: #2548

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 201341 force-pushed the swj/opt-deletenode branch 3 times, most recently from a0aafd4 to 0ef9c99 Compare September 12, 2023 12:50
@201341
Copy link
Contributor Author

201341 commented Sep 12, 2023

cicheck

@wuhongsong
Copy link
Contributor

sorry, now need rebase.

@201341 201341 force-pushed the swj/opt-deletenode branch 3 times, most recently from c553928 to 75e591e Compare October 10, 2023 08:46
@201341
Copy link
Contributor Author

201341 commented Oct 10, 2023

cicheck

Comment on lines 324 to 329
struct timespec now;
clock_gettime(CLOCK_REALTIME, &now);
Time* tm = new Time();
tm->set_sec(now.tv_sec);
tm->set_nsec(now.tv_nsec);
request.set_allocated_time(tm);
Copy link
Contributor

Choose a reason for hiding this comment

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

These codes are repeated multiple times, e.g., L258-263, consider extra into a function.

Copy link
Contributor

Choose a reason for hiding this comment

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

agree

Comment on lines 431 to 439
uint64_t now = 0;
uint32_t now_ns = 0;
if (request->has_time()) {
now = request->time().sec();
now_ns = request->time().nsec();
}
Time tm;
tm.set_sec(now);
tm.set_nsec(now_ns);
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto, repeated with L369

@201341 201341 force-pushed the swj/opt-deletenode branch 6 times, most recently from 2f78fb7 to 147109e Compare October 25, 2023 03:13
@201341
Copy link
Contributor Author

201341 commented Oct 25, 2023

cicheck

@201341
Copy link
Contributor Author

201341 commented Oct 25, 2023

cicheck

2 similar comments
@201341
Copy link
Contributor Author

201341 commented Oct 25, 2023

cicheck

@201341
Copy link
Contributor Author

201341 commented Oct 25, 2023

cicheck

Comment on lines 110 to 115
Time* MetaServerClientImpl::CreateTime() {
struct timespec now;
clock_gettime(CLOCK_REALTIME, &now);
Time* tm = new Time();
tm->set_sec(now.tv_sec);
tm->set_nsec(now.tv_nsec);
return tm;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be more appropriate to do something like this,

void SetCreateTime(Time* tm) {
    struct timespec now;
    clock_gettime(CLOCK_REALTIME, &now);
    tm->set_sec(now.tv_sec);
    tm->set_nsec(now.tv_nsec);
}

// caller
SetCreateTime(request.mutable_create());

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

@201341 201341 force-pushed the swj/opt-deletenode branch 2 times, most recently from 8ff8452 to 7c46d16 Compare October 25, 2023 10:01
@201341
Copy link
Contributor Author

201341 commented Oct 25, 2023

cicheck

1 similar comment
@201341
Copy link
Contributor Author

201341 commented Oct 25, 2023

cicheck

@@ -107,6 +107,13 @@ class MetaServerClientRpcDoneBase : public google::protobuf::Closure {
MetaServerClientMetric *metric_;
};

void MetaServerClientImpl::SetCreateTime(Time* tm) {
Copy link
Contributor

Choose a reason for hiding this comment

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

SetCreateTime should not be a member function, define it as a free function is ok.

@201341
Copy link
Contributor Author

201341 commented Nov 3, 2023

cicheck

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

201341 commented Nov 3, 2023

cicheck

@201341
Copy link
Contributor Author

201341 commented Nov 8, 2023

@SeanHai PTAL

@SeanHai SeanHai merged commit 095006a into opencurve:master Nov 17, 2023
4 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.

4 participants