Skip to content
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

Provide 'sys/step-down' and 'vault step-down' #1146

Merged
merged 6 commits into from Mar 3, 2016
Merged

Provide 'sys/step-down' and 'vault step-down' #1146

merged 6 commits into from Mar 3, 2016

Conversation

jefferai
Copy link
Member

This endpoint causes the node it's hit to step down from active duty.
It's a noop if the node isn't active or not running in HA mode. The node
will wait one second before attempting to reacquire the lock, to give
other nodes a chance to grab it.

Fixes #1093

This endpoint causes the node it's hit to step down from active duty.
It's a noop if the node isn't active or not running in HA mode. The node
will wait one second before attempting to reacquire the lock, to give
other nodes a chance to grab it.

Fixes #1093
// to perform any further operations.
func (c *Core) stepDownAndSeal(token string, seal bool) (retErr error) {
if seal {
defer metrics.MeasureSince([]string{"core", "seal"}, time.Now())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just move this into the appropriate methods above to make it cleaner

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about that; I was attempting to avoid copypasta since much of the logic is the same. But there's enough different that it can go either way.

return logical.ErrPermissionDenied
}

c.manualStepDownCh <- struct{}{}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should guard this with a default case in case there is no listener on the other side to avoid blocking.

@armon
Copy link
Member

armon commented Mar 3, 2016

One minor comment, LGTM

jefferai added a commit that referenced this pull request Mar 3, 2016
Provide 'sys/step-down' and 'vault step-down'
@jefferai jefferai merged commit a520728 into master Mar 3, 2016
@jefferai jefferai deleted the step-down branch March 3, 2016 17:30
rajanadar added a commit to rajanadar/VaultSharp that referenced this pull request Aug 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants