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/etcd leader #209
Feat/etcd leader #209
Conversation
Nice improvement! I love the idea to use Etcd to do the election. However, I have some different ideas about the design of the election flow. Use the synchronous way to run an electionWhat you did in this PR is in an asynchronous way, which is:
I prefer to use the synchronous way in fact, which is:
Describe in the pseudo-code
Avoid using a name like xxxutilThese general words like |
agreed |
db/etcdutil/elect.go
Outdated
} | ||
|
||
func (e *Elect) Campaign() { | ||
for { |
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.
这个 for 做的事情有点多, 感觉全哥说的那个方式挺好的
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.
即:
for {
campaign()
waitExpire()
}
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.
LGTM
Closes: #91