-
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
Backport of [NET-3865] [Supportability] Additional Information in the output - in 1.14.x #17828
Backport of [NET-3865] [Supportability] Additional Information in the output - in 1.14.x #17828
Conversation
…consul operator raft list-peers' (#17582) * init * fix tests * added -detailed in docs * added change log * fix doc * checking for entry in map * fix tests * removed detailed flag * removed detailed flag * revert unwanted changes * removed unwanted changes * updated change log * pr review comment changes * pr comment changes single API instead of two * fix change log * fix tests * fix tests * fix test operator raft endpoint test * Update .changelog/17582.txt Co-authored-by: Semir Patel <[email protected]> * nits * updated docs --------- Co-authored-by: Semir Patel <[email protected]>
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 changelog reflect the current PR?
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.
Looks good. Do check on the filename for changelog.txt. In one of my previous backports I used the current PR's number as the file name
Both PR content is same. So I guess no issues. |
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 😃
Description
As per requirement of NET - 3865, We want to have the 'commit_index' to be included in the output of 'consul operator raft list-peers -detailed'. This feature specifically useful in the cases where Consul is being upgraded to determine the replication rate and intervene as needed.
I have implemented it by calling a API
/v1/operator/autopilot/health
, storing the response in a map -> [server id, OperatorHealthReply]. Then this data is used to print the Commit Index by matching the id of server from this to server id in RaftGetConfiguration.Testing
Create a consul cluster by following this tutorial.
kubectl exec -it consul-server-0 -n consul -- /bin/sh
in one terminalkubectl exec -it consul-server-1 -n consul -- /bin/sh
in other terminaldo a ps and kill
consul agent
in the second terminal.Run command
consul operator raft list-peers
consul operator raft list-peers
PR Checklist