-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Handle leadership change and shutdown placement gracefully #2390
Handle leadership change and shutdown placement gracefully #2390
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2390 +/- ##
==========================================
+ Coverage 55.55% 56.59% +1.04%
==========================================
Files 79 80 +1
Lines 6698 6836 +138
==========================================
+ Hits 3721 3869 +148
+ Misses 2721 2709 -12
- Partials 256 258 +2
Continue to review full report at Codecov.
|
…r into youngp/graceful-shutdown
/ok-to-test |
Found the available test cluster - dapr-aks-e2e-06 for linux. Please check the build status. |
Found the available test cluster - dapr-aks-e2e-08 for windows. Please check the build status. |
Congrats! All end-to-end tests have passed on linux. Thanks for your contribution! |
Congrats! All end-to-end tests have passed on windows. Thanks for your contribution! |
@@ -59,7 +61,9 @@ func newConfig() *config { | |||
|
|||
flag.StringVar(&cfg.raftID, "id", cfg.raftID, "Placement server ID.") | |||
flag.StringVar(&cfg.raftPeerString, "initial-cluster", cfg.raftPeerString, "raft cluster peers") | |||
flag.BoolVar(&cfg.raftBootStrap, "cluster-bootstrap", cfg.raftBootStrap, "raft cluster bootstrap required") | |||
flag.BoolVar(&cfg.raftInMemEnabled, "inmem-store-enabled", cfg.raftInMemEnabled, "Enable in-memory log and snapshot store") |
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.
flag.BoolVar(&cfg.raftInMemEnabled, "inmem-store-enabled", cfg.raftInMemEnabled, "Enable in-memory log and snapshot store") | |
flag.BoolVar(&cfg.raftInMemEnabled, "inmem-store-enabled", cfg.raftInMemEnabled, "Enable in-memory log and snapshot store. Can only work if --raftLogStorePath is unset.") |
for { | ||
select { | ||
case isLeader := <-leaderCh: | ||
switch { |
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.
Will we anticipate more cases in this switch? Otherwise, change to if-else
?
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.
yes will do that.
Description
This PR is to handle leadership establishment and revoke scenario properly and shutdown placement gracefully to reduce the impact to runtime and the other placement nodes.
--cluster-bootstrap
and--raft-logstore-path
Run three placement nodes:
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #2377
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: