Skip to content

Backport of [NET-3865] [Supportability] Additional Information in the output of 'consul operator raft list-peers' into release/1.16.x#17738

Merged
asheshvidyut merged 11 commits intorelease/1.16.xfrom
backport/asheshvidyut/NET-3865/naturally-busy-raccoon
Jun 21, 2023
Merged

Backport of [NET-3865] [Supportability] Additional Information in the output of 'consul operator raft list-peers' into release/1.16.x#17738
asheshvidyut merged 11 commits intorelease/1.16.xfrom
backport/asheshvidyut/NET-3865/naturally-busy-raccoon

Conversation

@hc-github-team-consul-core
Copy link
Collaborator

Backport

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

🚨

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/naturally-busy-raccoon branch from 8e250b2 to 441ecc0 Compare June 14, 2023 15:13
@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/asheshvidyut/NET-3865/naturally-busy-raccoon branch 7 times, most recently from c9ceaa1 to 719855a Compare June 14, 2023 15:13
@github-actions github-actions bot added the theme/api Relating to the HTTP API interface label Jun 14, 2023
Copy link
Collaborator

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 theme/cli Flags and documentation for the CLI interface type/docs Documentation needs to be created/updated/clarified labels Jun 14, 2023
@vercel vercel bot temporarily deployed to Preview – consul June 14, 2023 15:24 Inactive
@david-yu
Copy link
Contributor

@absolutelightning We should merge this PR into 1.16.x after GA since code freeze happened yesterday.

@david-yu david-yu marked this pull request as ready for review June 20, 2023 23:42
@david-yu david-yu requested a review from a team as a code owner June 20, 2023 23:42
@david-yu
Copy link
Contributor

@absolutelightning Could you check that all the commits went into this PR? Feel free to merge as this won't affect the 1.16.0 GA if we merge to release/1.16.x

@asheshvidyut
Copy link
Contributor

@david-yu Resolved

@asheshvidyut asheshvidyut merged commit b61cfa8 into release/1.16.x Jun 21, 2023
@asheshvidyut asheshvidyut deleted the backport/asheshvidyut/NET-3865/naturally-busy-raccoon branch June 21, 2023 05:56
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.

4 participants