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

Backport of [NET-3865] [Supportability] Additional Information in the output - in 1.14.x #17828

Merged

Conversation

absolutelightning
Copy link
Contributor

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 terminal
kubectl exec -it consul-server-1 -n consul -- /bin/sh in other terminal
do a ps and kill consul agent in the second terminal.
Run command consul operator raft list-peers

  • execute the following command when agent is running
  • consul operator raft list-peers
  • Output -

Screenshot 2023-06-08 at 10 36 07 PM

PR Checklist

  • updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

…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>
@absolutelightning absolutelightning requested a review from a team as a code owner June 21, 2023 04:12
@github-actions github-actions bot added theme/api Relating to the HTTP API interface theme/cli Flags and documentation for the CLI interface type/docs Documentation needs to be created/updated/clarified labels Jun 21, 2023
@absolutelightning absolutelightning changed the title [NET-3865] [Supportability] Additional Information in the output of '… Back port [NET-3865] [Supportability] Additional Information in the output - in 1.14.x Jun 21, 2023
@absolutelightning absolutelightning changed the title Back port [NET-3865] [Supportability] Additional Information in the output - in 1.14.x Backport of [NET-3865] [Supportability] Additional Information in the output - in 1.14.x Jun 21, 2023
Copy link
Contributor

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?

Copy link
Contributor

@Ganeshrockz Ganeshrockz left a 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

@absolutelightning
Copy link
Contributor Author

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.

@absolutelightning absolutelightning merged commit f4ea364 into release/1.14.x Jun 21, 2023
94 of 95 checks passed
@absolutelightning absolutelightning deleted the manual-backport-release/1.14.x-NET-3865 branch June 21, 2023 05:22
Copy link

@srahul3 srahul3 left a comment

Choose a reason for hiding this comment

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

LGTM 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consul-india PRs/Issues assigned to Consul India team pr/no-backport theme/api Relating to the HTTP API interface theme/cli Flags and documentation for the CLI interface type/docs Documentation needs to be created/updated/clarified
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants