-
Notifications
You must be signed in to change notification settings - Fork 721
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
mcs: register resource manager to etcd #6040
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Skipping CI for Draft Pull Request. |
Codecov ReportBase: 74.91% // Head: 74.83% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #6040 +/- ##
==========================================
- Coverage 74.91% 74.83% -0.08%
==========================================
Files 367 367
Lines 36595 36598 +3
==========================================
- Hits 27415 27388 -27
- Misses 6792 6813 +21
- Partials 2388 2397 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
the rest LGTM
@@ -275,6 +279,9 @@ func (s *Server) startServer() error { | |||
|
|||
// Server has started. | |||
atomic.StoreInt64(&s.isServing, 1) | |||
// register to etcd | |||
s.serviceRegister = discovery.NewServiceRegister(s.ctx, s.etcdClient, "resource_manager", s.cfg.ListenAddr, s.cfg.ListenAddr, 3) |
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.
3?
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.
3 seconds
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.
how about refactor the function's signature for the ttl unit, and make it more clear.
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.
If more clear, it will be better.
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.
How about using a constant? like leaseInSeconds? I just keep consistent with etcd.
@@ -275,6 +279,9 @@ func (s *Server) startServer() error { | |||
|
|||
// Server has started. | |||
atomic.StoreInt64(&s.isServing, 1) | |||
// register to etcd |
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.
do we also need to register when running legacy server?
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.
No, it will only register when the resource manager is started as an independent binary.
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.
I think this comment is useless.
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.
I will remove it.
|
||
cfg := rm.NewConfig() | ||
cfg.BackendEndpoints = leader.GetAddr() | ||
cfg.ListenAddr = "127.0.0.1:8087" |
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.
What does it happen if the address has been bound? It maybe help
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.
I copied from TestResourceManagerServer
, seems it also has the problem. @lhy1024
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.
I will fix it
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.
replace it with tempurl.Alloc()
in #6047
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.
reset LGTM
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
b7e7ebb
to
a0ecabb
Compare
/merge |
@bufferflies: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: a0ecabb
|
What problem does this PR solve?
This PR is going to register the resource manager into etcd after starting.
Issue Number: Ref #5766.
What is changed and how does it work?
Check List
Tests
Release note