-
Notifications
You must be signed in to change notification settings - Fork 955
Add SAFE option to SHUTDOWN to reject shutdown in unsafe situations #2195
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
Conversation
Add SAFE option to SHUTDOWN. If we passed SAFE, the SHUTDOWN will refuse to shutdown if it is not safe to shutdown. Like if myself is a voting primary, it will refuse to shutdown. This avoids the situation where a replica suddenly becomes the primary when we shutting down the replica, or shutting down a primary node by mistake and then causing the cluster to down. Add SAFE option to SHUTDOWN command. Add safe option to shutdown-on-sigint and shutdown-on-sigterm. Note that safe cannot prevent force, in the case of force, safe will print the relevant logs and do the force shutdown. Signed-off-by: Binbin <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## unstable #2195 +/- ##
============================================
- Coverage 71.50% 71.35% -0.15%
============================================
Files 122 123 +1
Lines 66452 66936 +484
============================================
+ Hits 47515 47764 +249
- Misses 18937 19172 +235
🚀 New features to boost your workflow:
|
|
Didn't really read the code, but directionally I'm OK with adding a safe option to shutdown. |
Signed-off-by: Binbin <[email protected]>
madolson
left a comment
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've now actually read the code and am OK with it.
jsoref
left a comment
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.
This is a slightly more detailed reading of the text with an English lense.
Signed-off-by: Binbin <[email protected]>
|
thanks for the review and suggestions, sorry about that, i have always had this problem, chinese english as a Chinese, i am very bad at grammar. |
Co-authored-by: Viktor Söderqvist <[email protected]> Signed-off-by: Binbin <[email protected]>
|
@valkey-io/core-team Do any of you want to review (or ack) it before the final merge? |
zuiderkwast
left a comment
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.
ACK
Signed-off-by: Binbin <[email protected]>
Signed-off-by: Binbin <[email protected]>
…325) See valkey-io/valkey#2195. Signed-off-by: Binbin <[email protected]>
In #1091, a new config `auto-failover-on-shutdown` was added. This PR changes the config to make it unified with other shutdown related options. This feature has not yet been released, so it's not a breaking change. The auto-failover-on-shutdown config is replaced by * A new "failover" option to the existing configs `shutdown-on-sigterm` and `shutdown-on-sigint`. * A new FAILOVER option to the SHUTDOWN command. Additionally, a history entry is added to the SHUTDOWN command which was missing in #2195. Follow-up of #1091. Signed-off-by: Viktor Söderqvist <[email protected]>
Add SAFE option to SHUTDOWN. If we passed SAFE, the SHUTDOWN
will refuse to shutdown if it is not safe to shutdown. Like if
myself is a voting primary, it will refuse to shutdown. This
avoids the situation where a replica suddenly becomes the primary
when we shutting down the replica, or shutting down a primary node
by mistake and then causing the cluster to down.
Add SAFE option to SHUTDOWN command.
Add safe option to shutdown-on-sigint and shutdown-on-sigterm.
Note that SAFE cannot prevent FORCE, in the case of FORCE, SAFE
will print the relevant logs and do the FORCE shutdown, we allow
this combination.
Doc PR: valkey-io/valkey-doc#325