-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
VAULT-32568: Shutdown node when it's not in the raft config #29052
base: main
Are you sure you want to change the base?
Conversation
CI Results:
|
Build Results: |
@@ -1391,6 +1402,9 @@ func (b *RaftBackend) SetupCluster(ctx context.Context, opts SetupOpts) error { | |||
} | |||
} | |||
|
|||
if opts.RemovedCallback != nil { | |||
b.removedCallback = opts.RemovedCallback |
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.
Should this be a call to SetRemovedCallback
instead? (Genuine question, I am not sure if we care about locking at this point.)
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
@@ -1030,6 +1031,12 @@ func (b *RaftBackend) SetRestoreCallback(restoreCb restoreCallback) { | |||
b.fsm.l.Unlock() | |||
} | |||
|
|||
func (b *RaftBackend) SetRemovedCallback(cb func()) { |
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.
func (b *RaftBackend) SetRemovedCallback(cb func()) { | |
func (b *RaftBackend) setRemovedCallback(cb func()) { |
Can we leave this function unexported?
Description
This PR has a removed node shutdown if it sees that it's not in the raft configuration. For extra safety's sake, the node must have previously been present in the configuration in order for the node to shutdown.
TODO only if you're a HashiCorp employee
backport/
label that matches the desired release branch. Note that in the CE repo, the latest release branch will look likebackport/x.x.x
, but older release branches will bebackport/ent/x.x.x+ent
.of a public function, even if that change is in a CE file, double check that
applying the patch for this PR to the ENT repo and running tests doesn't
break any tests. Sometimes ENT only tests rely on public functions in CE
files.
in the PR description, commit message, or branch name.
description. Also, make sure the changelog is in this PR, not in your ENT PR.