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

Zipper CarbonV2 gRPC render stream #370

Merged
merged 5 commits into from
Jul 19, 2022
Merged

Conversation

emadolsky
Copy link
Contributor

@emadolsky emadolsky commented Jul 4, 2022

This PR adds the functionality of gRPC streaming Renders in carbonzipper. The new gRPC protocol is proposed at go-graphite/protocol#12, and storage part is implemented on go-graphite/go-carbon#476.

Outline:

A new backend configuration structure is proposed as ProtocolBackend which defines different protocol addresses of a backend. The change is backward compatible.

The current implementation only uses gRPC for Renders as we have not implemented other APIs here or in go-carbon. For the other APIs such as Find, old methods are used.

The changes are tested manually in container environment.

Some works should be done before merging:

  • More tests on real-life workload

@emadolsky emadolsky force-pushed the emadolsky/zipper-render-stream branch 2 times, most recently from 4e19da3 to e4a6a8c Compare July 4, 2022 12:18
@emadolsky emadolsky force-pushed the emadolsky/zipper-render-stream branch from e4a6a8c to 0b22237 Compare July 13, 2022 13:00
@emadolsky emadolsky changed the title Emadolsky/zipper render stream Zipper CarbonV2 gRPC render stream Jul 13, 2022
pkg/backend/grpc/grpc.go Outdated Show resolved Hide resolved
@emadolsky emadolsky marked this pull request as ready for review July 18, 2022 14:50
@emadolsky emadolsky requested a review from bom-d-van July 18, 2022 14:54
protocolBackends:
- http: "http://10.291.202.31:8080"
- http: "http://10.291.197.91:8080"
grpc: "10.291.197.91:7070"
Copy link
Collaborator

Choose a reason for hiding this comment

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

it's minor, but you can simplify things by:

protocolBackends:
- "http://10.291.202.31:8080"
- "http://10.291.197.91:8080"
  "grpc://10.291.197.91:7070"

net/url pkg actually supports parsing it: https://pkg.go.dev/net/url@go1.18.4#Parse

Copy link
Contributor Author

@emadolsky emadolsky Jul 19, 2022

Choose a reason for hiding this comment

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

I have difficulty understanding the structure of protocolBackend. Do you mean it can be simplified to list of strings? In that case it would be like:

protocolBackends:
- ["http://10.291.202.31:8080"]
- ["http://10.291.197.91:8080",
  "grpc://10.291.197.91:7070"]

Which is not desired IMO. However, after implementing gRPC for all of the calls, it can be simplified to one string in which url scheme determines the backend type. E.g.

protocolBackends:
- "http://10.291.202.31:8080"
- "grpc://10.291.197.91:7070"

Copy link
Collaborator

Choose a reason for hiding this comment

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

oops, sorry, the example that I gave wasn't correct, I wanted to suggest an array of array:

protocolBackends:
- "http://10.291.202.31:8080"
- - "http://10.291.197.91:8080"
  - "grpc://10.291.197.91:7070"

Copy link
Collaborator

@bom-d-van bom-d-van left a comment

Choose a reason for hiding this comment

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

left one more small comment. but not a blocker and the rest seems good to me, so approved.

(I will leave the real check to production. :P)

@emadolsky emadolsky merged commit 0729fcb into master Jul 19, 2022
@emadolsky emadolsky deleted the emadolsky/zipper-render-stream branch July 19, 2022 12:46
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.

None yet

2 participants