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 of 'consul operator raft list-peers' into release/1.15.x #17737

Conversation

hc-github-team-consul-core
Copy link
Contributor

Backport

This PR is auto-generated from #17582 to be assessed for backporting due to the inclusion of the label backport/1.15.

🚨

Warning automatic cherry-pick of commits failed. If the first commit failed,
you will see a blank no-op commit below. If at least one commit succeeded, you
will see the cherry-picked commits up to, not including, the commit where
the merge conflict occurred.

The person who merged in the original PR is:
@absolutelightning
This person should manually cherry-pick the original PR into a new backport PR,
and close this one when the manual backport PR is merged in.

merge conflict error: unable to process merge commit: "13903531eacb25fca9a599a0cdd4f70d47e5f006", automatic backport requires rebase workflow

The below text is copied from the body of the original PR.


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

Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/asheshvidyut/NET-3865/internally-splendid-herring branch 5 times, most recently from 707e496 to f268323 Compare June 14, 2023 15:13
@github-actions github-actions bot added theme/api Relating to the HTTP API interface theme/cli Flags and documentation for the CLI interface labels Jun 14, 2023
Copy link

Choose a reason for hiding this comment

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

Auto approved Consul Bot automated PR

@github-actions github-actions bot added the type/docs Documentation needs to be created/updated/clarified label Jun 14, 2023
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging June 14, 2023 15:20 Inactive
@vercel vercel bot temporarily deployed to Preview – consul June 14, 2023 15:23 Inactive
absolutelightning and others added 8 commits June 18, 2023 08:43
…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>
…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 marked this pull request as ready for review June 18, 2023 04:03
@absolutelightning absolutelightning requested a review from a team as a code owner June 18, 2023 04:03
@absolutelightning absolutelightning enabled auto-merge (squash) June 18, 2023 04:11
@absolutelightning absolutelightning merged commit 6a833cd into release/1.15.x Jun 18, 2023
@absolutelightning absolutelightning deleted the backport/asheshvidyut/NET-3865/internally-splendid-herring branch June 18, 2023 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants