-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Leadership transfer cmd #14132
Leadership transfer cmd #14132
Conversation
@mkeeler I undusted this PR, if you happen to have some spare time. I had to create a new one and close #12182 because of some git weirdness but I went though all your comments
Added an OSS test I will add one for enterprise after it get merged.
Added the ID to the request and threaded through to the API and the CLI.
I changed |
@dhiaayachi : what are your thoughts on aligning the naming of this command more with the existing Vault name for similar functionality: Vault provides an operator-level CLI command and HTTP API endpoint for forcing the current leader to gracefully step down. Someone familiar with this capability in Vault might look for something with the same name in Consul (internally, at least one person has asked if Consul had a similar "step down" capability). That said, I can see the advantages of Just wanted to share these thoughts with you to consider. Side question: when running this command, can the leader immediately be re-elected? Or is a different server agent always elected (if available)? |
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.
Left some thoughts / optional suggestions.
Thanks for seeing this through, @dhiaayachi !
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.
The code generally looks good.
The biggest concern is that we would be adding additional net-new RPC endpoints that are not gRPC. I would love to see protobuf definitions for the request/response types and a gRPC service. The HTTP/cli bits as well as the internal attemptLeaderTransfer
code shouldn't need alteration.
Co-authored-by: Matt Keeler <mkeeler@users.noreply.github.com>
Co-authored-by: Matt Keeler <mkeeler@users.noreply.github.com>
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.
@dhiaayachi : left a few comments on the docs pages. Thanks!
Co-authored-by: Jared Kirschner <85913323+jkirschner-hashicorp@users.noreply.github.com>
Co-authored-by: Jared Kirschner <85913323+jkirschner-hashicorp@users.noreply.github.com>
Co-authored-by: Jared Kirschner <85913323+jkirschner-hashicorp@users.noreply.github.com>
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 reviewed the edits to api-docs/operator/raft.mdx
and commands/operator/raft.mdx`. Please implement the suggestions - and be sure to align both pages to either "node id" or "server id."
Please let me know if you need any additional review or assistance.
Approving on behalf of consul-docs.
Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com>
The leadership transfer command will be available starting in Consul 1.15.0! |
Description
This is an attempt to implement a command that would trigger a raft leadership transfer.
The idea about this trace back to a customer issue where we needed to trigger leader transfer to be able to upgrade a leader node.
This dependent to a change in raft that fix some of the gaps in leadership transfer, those gaps would make the transfer fail. hashicorp/raft#487
I made an attempt in naming the sub command but open to any suggestions.
Testing & Reproduction steps
Added tests: