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

etcdserver: add auth revision to AuthStatus to improve observability and testability #11659

Merged
merged 2 commits into from
Mar 9, 2020

Conversation

wswcfan
Copy link
Contributor

@wswcfan wswcfan commented Feb 26, 2020

This pr is a completion for last pr #11652 , to improve the auth revision's observability and testability

Copy link
Contributor

@mitake mitake left a comment

Choose a reason for hiding this comment

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

Thanks for your change. Could you move the field and the code to fill the field to AuthStatus?

etcdserver/etcdserverpb/rpc.proto Outdated Show resolved Hide resolved
etcdserver/api/v3rpc/maintenance.go Outdated Show resolved Hide resolved
@jingyih
Copy link
Contributor

jingyih commented Mar 1, 2020

Agree with @mitake, adding a field in AuthStatus API sounds good. In the short term, if you want something available in etcd v3.4, consider adding a metric (metric is usually backportable).

@wswcfan wswcfan changed the title etcdserver: add auth revision to StatusResponse to improve observability and testability etcdserver: add auth revision to AuthStatus to improve observability and testability Mar 1, 2020
@wswcfan
Copy link
Contributor Author

wswcfan commented Mar 1, 2020

Thanks for your reply and suggestion. I have moved the AuthRevision field to AuthStatus now.
PTAL @mitake @jingyih

@wswcfan wswcfan requested a review from mitake March 1, 2020 19:14
Copy link
Contributor

@jingyih jingyih left a comment

Choose a reason for hiding this comment

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

Thank you! Looks good in general. Not exactly sure why v3election.swagger.json and v3lock.swagger.json were updated because there was no change to those APIs - I guess it is because of a different version of protoc-gen-swagger?

etcdctl/ctlv3/command/printer_simple.go Show resolved Hide resolved
@wswcfan
Copy link
Contributor Author

wswcfan commented Mar 3, 2020

Thank you! Looks good in general. Not exactly sure why v3election.swagger.json and v3lock.swagger.json were updated because there was no change to those APIs - I guess it is because of a different version of protoc-gen-swagger?

Thanks for response. I found that the GRPC_GATEWAY_SHA defined in the scripts/genproto.sh is invalid, result that we always install newest version of protoc-gen-grpc-gateway and protoc-gen-swagger, rather than the specific version. The protoc-gen-swagger release a new version v1.13.0 recently, it adds a "default" error entry to all responses in the swagger definitions (grpc-ecosystem/grpc-gateway#1127), that's why all *.swagger.json were updated.
So, Shall we fix the scripts/genproto.sh? I don't sure which version of protoc-gen-grpc-gateway and protoc-gen-swagger we need now. @jingyih

@jingyih
Copy link
Contributor

jingyih commented Mar 3, 2020

@wswcfan I am not an expert on this. My suggestion is: 1. open a separate PR to update GRPC_GATEWAY_SHA to the latest release, and update the generated files. 2. rebase this PR after 1 is merged (which makes the diff in this PR clearer).

Any concerns on moving to latest protoc-gen-grpc-gateway and protoc-gen-swagger? @gyuho @hexfusion

@wswcfan
Copy link
Contributor Author

wswcfan commented Mar 3, 2020

@wswcfan I am not an expert on this. My suggestion is: 1. open a separate PR to update GRPC_GATEWAY_SHA to the latest release, and update the generated files. 2. rebase this PR after 1 is merged (which makes the diff in this PR clearer).

Any concerns on moving to latest protoc-gen-grpc-gateway and protoc-gen-swagger? @gyuho @hexfusion

Sorry, my mistake. the GRPC_GATEWAY_SHA have no problem. I copyed a wrong SHA just now. The only thing is that scripts/genproto.sh doesn't define specific version of protoc-gen-swagger, it will use the latest version. I'm not sure if the latest version is what we need. If the latest version is as expected,
I can make another Commit or PR to generate the swagger file using the latest protoc-gen-swagger. Thanks.

@jingyih
Copy link
Contributor

jingyih commented Mar 4, 2020

If the latest version is as expected,
I can make another Commit or PR to generate the swagger file using the latest protoc-gen-swagger. Thanks.

This sounds good to me. If it causes any backward compatibility issue or other issue, we could always revert it.

@codecov-io
Copy link

Codecov Report

Merging #11659 into master will decrease coverage by 0.2%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11659      +/-   ##
==========================================
- Coverage   66.41%    66.2%   -0.21%     
==========================================
  Files         402      402              
  Lines       36661    36667       +6     
==========================================
- Hits        24349    24276      -73     
- Misses      10826    10890      +64     
- Partials     1486     1501      +15
Impacted Files Coverage Δ
etcdctl/ctlv3/command/auth_command.go 38.98% <0%> (ø) ⬆️
etcdctl/ctlv3/command/printer_simple.go 0% <0%> (ø) ⬆️
etcdctl/ctlv3/command/printer.go 0% <0%> (ø) ⬆️
etcdserver/apply.go 79.17% <0%> (-0.13%) ⬇️
clientv3/ordering/kv.go 2.94% <0%> (-82.36%) ⬇️
auth/options.go 57.5% <0%> (-35%) ⬇️
client/members.go 65.32% <0%> (-20.17%) ⬇️
pkg/transport/timeout_conn.go 80% <0%> (-20%) ⬇️
client/client.go 65.03% <0%> (-18.96%) ⬇️
clientv3/txn.go 86.66% <0%> (-13.34%) ⬇️
... and 22 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6f850a6...15eeb2c. Read the comment docs.

@wswcfan
Copy link
Contributor Author

wswcfan commented Mar 4, 2020

I have split this PR into two commits, the first one just generate swagger doc, it may look cleaner now.
Thanks for your suggestion. @jingyih

Copy link
Contributor

@jingyih jingyih left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

Copy link
Contributor

@mitake mitake left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! I'm merging this.

@mitake mitake merged commit 6d1982e into etcd-io:master Mar 9, 2020
jingyih added a commit that referenced this pull request Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants