Skip to content

Add support for pinot proxy#13015

Merged
martint merged 1 commit intotrinodb:masterfrom
xiangfu0:pinot-proxy-support
Oct 9, 2022
Merged

Add support for pinot proxy#13015
martint merged 1 commit intotrinodb:masterfrom
xiangfu0:pinot-proxy-support

Conversation

@xiangfu0
Copy link
Copy Markdown
Contributor

@xiangfu0 xiangfu0 commented Jun 28, 2022

Description

Pinot proxy is used as the global user-facing endpoint to handle all controller/broker HTTP requests as well as server gRPC requests for Trino. This is a must when connecting pinot inside a k8s cluster externally.

Adding support to enable pinot proxy for broker and grpc requests.
This feature is default disabled and can be enabled by specifying the rest proxy REST/GRPC endpoints:

pinot.controller-urls=https://my-pinot-rest-proxy:8123
pinot.proxy.enabled=true
pinot.grpc.proxy-uri=my-pinot-rest-proxy:8124

Release notes

# Pinot Changes
* Adding support to enable pinot proxy for controller/broker and server grpc requests.

@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Jun 28, 2022

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to cla@trino.io. For more information, see https://github.com/trinodb/cla.

@ebyhr ebyhr requested review from elonazoulay and hashhar June 28, 2022 11:30
@xiangfu0 xiangfu0 force-pushed the pinot-proxy-support branch from e929b0e to ec42443 Compare June 30, 2022 02:33
@cla-bot cla-bot bot added the cla-signed label Jun 30, 2022
@xiangfu0 xiangfu0 force-pushed the pinot-proxy-support branch 4 times, most recently from 1d9bdb6 to dfecbcb Compare July 1, 2022 22:02
Copy link
Copy Markdown
Member

@ebyhr ebyhr left a comment

Choose a reason for hiding this comment

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

@xiangfu0 xiangfu0 changed the title Adding support for pinot proxy Support pinot proxy for pinot controller, broker and server grpc traffic routing. Jul 29, 2022
@xiangfu0
Copy link
Copy Markdown
Contributor Author

xiangfu0 commented Aug 4, 2022

Will rebase once: #13410 and #13469 are merged

@xiangfu0 xiangfu0 marked this pull request as draft September 14, 2022 09:08
@xiangfu0 xiangfu0 force-pushed the pinot-proxy-support branch 3 times, most recently from 00b67d2 to 8338e5b Compare September 14, 2022 10:10
@github-actions github-actions bot added the docs label Sep 14, 2022
@xiangfu0 xiangfu0 marked this pull request as ready for review September 14, 2022 10:11
@xiangfu0 xiangfu0 force-pushed the pinot-proxy-support branch 5 times, most recently from 09f3bf7 to 0c75d20 Compare September 14, 2022 17:59
@xiangfu0 xiangfu0 requested review from ebyhr and martint September 14, 2022 18:09
Copy link
Copy Markdown
Member

@hashhar hashhar left a comment

Choose a reason for hiding this comment

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

some editorial comments.

can you explain why multiple proxy configs need to exist? Also does the proxy remove the need to configure the controller url?
Or are they mutually exclusive? If yes then the config classes should assert that otherwise it's both hard for user to understand what to configure when and also for reviewers/future authors to understand that.

Copy link
Copy Markdown
Member

@hashhar hashhar left a comment

Choose a reason for hiding this comment

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

Much simpler than before. Thanks.

Some nits but looks good otherwise.

@xiangfu0 xiangfu0 force-pushed the pinot-proxy-support branch from 6b9a8e5 to 50676ec Compare October 2, 2022 03:51
@xiangfu0
Copy link
Copy Markdown
Contributor Author

xiangfu0 commented Oct 2, 2022

Thanks for the review!

@xiangfu0 xiangfu0 requested review from hashhar and martint October 2, 2022 08:49
@xiangfu0 xiangfu0 force-pushed the pinot-proxy-support branch from 50676ec to 6eea82c Compare October 3, 2022 02:17
@martint
Copy link
Copy Markdown
Member

martint commented Oct 3, 2022

Given that the controller and the proxy are API compatible, I'm not sure I understand why we need a separate pinot.grpc.proxy-uri instead of just reusing the host/port for the controller.

@xiangfu0
Copy link
Copy Markdown
Contributor Author

xiangfu0 commented Oct 3, 2022

Given that the controller and the proxy are API compatible, I'm not sure I understand why we need a separate pinot.grpc.proxy-uri instead of just reusing the host/port for the controller.

The current connector requires REST API access to Pinot Controller/Broker, for cluster/table management and broker queries those APIs are made compatible in Pinot Proxy, so we can reuse proxy REST endpoint for controller, e.g. https://proxy.my-pinot-cluster:443

This connector also requires GRPC access to Pinot Servers for server queries data transfer, which are not exposed outside k8s. So we need to expose them through Pinot Proxy and build a Load Balancer on that, hence the new URI, e.g. grpc.proxy.my-pinot-cluster:443

@martint
Copy link
Copy Markdown
Member

martint commented Oct 7, 2022

I'm still a little confused.

When pinot.proxy.enabled is true, what is the role of pinot.grpc.port compared to pinot.grpc.proxy-uri. Does pinot.grpc.port get used at all? What for?

@xiangfu0
Copy link
Copy Markdown
Contributor Author

xiangfu0 commented Oct 8, 2022

I'm still a little confused.

When pinot.proxy.enabled is true, what is the role of pinot.grpc.port compared to pinot.grpc.proxy-uri. Does pinot.grpc.port get used at all? What for?

So this pinot.grpc.port remains the same as the Pinot server grpc port.

pinot.grpc.proxy-uri is the entry point for external grpc access. Inside the proxy it will connect to the server grpc endpoint ( configured in pinot.grpc.port) for server queries.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's the purpose of extending from GrpcRequestBuilder? There's not an "is a" relationship between the two classes, and this class seems to be overriding every method from the parent that's used.

In fact, the only method that's used from the parent is a call to setBrokerRequest(), but the build() method does not use that value at all.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point, Pinot 0.10+ has deprecated the BrokerRequest, so we actually don't have to keep it.
And the PinotProxyGrpcRequestBuilder doesn't need to extend GrpcRequestBuilder.

@xiangfu0 xiangfu0 force-pushed the pinot-proxy-support branch from 6eea82c to 563087e Compare October 8, 2022 18:53
@xiangfu0
Copy link
Copy Markdown
Contributor Author

xiangfu0 commented Oct 8, 2022

Updated the PR and rebase with Pinot 0.11 upgrade

@martint
Copy link
Copy Markdown
Member

martint commented Oct 8, 2022

Looks good. Can you squash the commits and change the text to "Add support for pinot proxy"?

@xiangfu0 xiangfu0 force-pushed the pinot-proxy-support branch from 563087e to 5904bc3 Compare October 9, 2022 00:11
@xiangfu0
Copy link
Copy Markdown
Contributor Author

xiangfu0 commented Oct 9, 2022

Looks good. Can you squash the commits and change the text to "Add support for pinot proxy"?

Thanks! Done!

@xiangfu0 xiangfu0 changed the title Support pinot proxy for pinot controller, broker and server grpc traffic routing. Add support for pinot proxy Oct 9, 2022
@xiangfu0 xiangfu0 requested a review from martint October 9, 2022 00:12
@xiangfu0
Copy link
Copy Markdown
Contributor Author

xiangfu0 commented Oct 9, 2022

Saw a failing https://github.com/trinodb/trino/actions/runs/3212258524/jobs/5251078085
Seems the master branch is also failing. Will wait for the fix and rebase.

@xiangfu0 xiangfu0 force-pushed the pinot-proxy-support branch from 5904bc3 to f9e38ff Compare October 9, 2022 07:48
@xiangfu0 xiangfu0 force-pushed the pinot-proxy-support branch from f9e38ff to a5769f9 Compare October 9, 2022 20:34
@xiangfu0
Copy link
Copy Markdown
Contributor Author

xiangfu0 commented Oct 9, 2022

Saw a failing https://github.com/trinodb/trino/actions/runs/3212258524/jobs/5251078085 Seems the master branch is also failing. Will wait for the fix and rebase.

Rebased and passed the CI.

@martint martint merged commit 4ae6fcd into trinodb:master Oct 9, 2022
@github-actions github-actions bot added this to the 400 milestone Oct 9, 2022
@xiangfu0
Copy link
Copy Markdown
Contributor Author

xiangfu0 commented Oct 9, 2022

Many thanks @martint !

@xiangfu0 xiangfu0 deleted the pinot-proxy-support branch October 9, 2022 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants