Backport of [NET-3865] [Supportability] Additional Information in the output - in 1.14.x#17828
Merged
asheshvidyut merged 1 commit intorelease/1.14.xfrom Jun 21, 2023
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 <semir.patel@hashicorp.com> * nits * updated docs --------- Co-authored-by: Semir Patel <semir.patel@hashicorp.com>
Ganeshrockz
reviewed
Jun 21, 2023
Contributor
There was a problem hiding this comment.
Should this changelog reflect the current PR?
aahel
approved these changes
Jun 21, 2023
Ganeshrockz
approved these changes
Jun 21, 2023
Contributor
Ganeshrockz
left a comment
There was a problem hiding this comment.
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
Contributor
Author
Both PR content is same. So I guess no issues. |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/shin one terminalkubectl exec -it consul-server-1 -n consul -- /bin/shin other terminaldo a ps and kill
consul agentin the second terminal.Run command
consul operator raft list-peersconsul operator raft list-peersPR Checklist