-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
etcdserver: export method EtcdServer.leaderChangedNotify (#12378) #12410
Conversation
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions. |
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.
Please justify the change / describe problem you are trying to solve.
From first glance it sounds to me as undesired, as the space is implementation detail of etcd.
When use etcd in Embed mode,the only way to know etcd leader changes is to poll the EtcdServer.Lead, and that way wastes some cpu cycles. |
etcdserver/server.go
Outdated
@@ -1689,7 +1689,7 @@ func (s *EtcdServer) getLead() uint64 { | |||
return atomic.LoadUint64(&s.lead) | |||
} | |||
|
|||
func (s *EtcdServer) leaderChangedNotify() <-chan struct{} { | |||
func (s *EtcdServer) LeaderChangedNotify() <-chan struct{} { |
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.
Please add it to the 'Server' interface.
Please comment on the semantic:
- that this channel is being closed when the leadership changes.
- so the new channel needs to be obtained for each term.
- That you can loose some consecutive channel changes using this API.
895b9e5
to
aedf370
Compare
Thank you. now PASSES="fmt" ./test.sh fails with:
|
Fixed |
Thank you. |
No description provided.