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.14.x #17736

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.14.

🚨

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: POST https://api.github.com/repos/hashicorp/consul/merges: 409 Merge conflict []

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

@hashicorp-cla
Copy link

hashicorp-cla commented Jun 14, 2023

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes


1 out of 2 committers have signed the CLA.

  • absolutelightning
  • temp

temp seems not to be a GitHub user.
You need a GitHub account to be able to sign the CLA. If you already have a GitHub account, please add the email address used for this commit to your account.

Have you signed the CLA already but the status is still pending? Recheck it.

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

@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/asheshvidyut/NET-3865/gratefully-apt-haddock branch from ffd20cf to 4274041 Compare June 14, 2023 15:13
@vercel vercel bot temporarily deployed to Preview – consul June 14, 2023 15:23 Inactive
…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]>
@absolutelightning absolutelightning marked this pull request as ready for review June 18, 2023 02:59
@absolutelightning absolutelightning requested a review from a team as a code owner June 18, 2023 02:59
@absolutelightning absolutelightning enabled auto-merge (squash) June 18, 2023 03:12
@absolutelightning
Copy link
Contributor

@david-yu Who will approve from hashicorp/consul-docs?

@absolutelightning
Copy link
Contributor

absolutelightning commented Jun 18, 2023

@analogue Hi, I am not able to merge this. Please help. I have already signed the agreement.
cc @david-yu

@analogue
Copy link
Collaborator

@analogue Hi, I am not able to merge this. Please help. I have already signed the agreement. cc @david-yu

@jmurret Any guidance here regarding the "temp" user and the CLA? Is this something we're responsible for or part of a rel-eng owned process?

@jmurret
Copy link
Member

jmurret commented Jun 20, 2023

@analogue I'm not sure. I'll ping releng and copy you.

@jmurret
Copy link
Member

jmurret commented Jun 20, 2023

@analogue @absolutelightning

It looks like the PR description when this was created has the answer:

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.

There is no way to get around the no-op commit that created this PR. If you don't want to create a new PR, then you can locally do something like the below that will effectively get rid of the no-op commit if you have already cherry-picked into this branch:

git reset --soft release/1.14.x

git commit -m '<insert message about manual cherry pick>'

git push -f

@absolutelightning
Copy link
Contributor

Closing this one have created a new one. #17736
@analogue

auto-merge was automatically disabled June 21, 2023 04:14

Pull request was closed

@analogue
Copy link
Collaborator

Closing this one have created a new one. #17736 @analogue

That is a link back to this PR and I couldn't find a new PR with the same content.

@absolutelightning
Copy link
Contributor

Closing this one have created a new one. #17736 @analogue

That is a link back to this PR and I couldn't find a new PR with the same content.

Here - #17828

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants