-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
feat: support FlightSQL in 3.0 #24678
Conversation
This commit adds the ability to serve FlightSQL queries. gRPC is served over the same address as HTTP. The Arrow Flight service is set up, although some of the underlying traits are not complete.
This commit brings support to the influxdb3 server to handle gRPC requests, i.e., FlightSQL requests. The primary server will route gRPC reqeusts to an underlying FlightService, while other requests will still go through to the standard REST HTTP server. A test was added to check that it was actually working, along with some common test helpers to spawn a server for testing.
1252841
to
940f1de
Compare
👏 this was never something I was able to figure out when implementing the services in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. I have nothing to say here besides great job. It's wild to see it "Just Work™" and over the same port as well. Kudos. I'm just going to approve this cause I wouldn't change anything myself.
Created #24695 to come back and add some documentation. |
Closes #24643
This PR adds support for FlightSQL queries via gRPC to the
influxdb3
service. It does so by ensuring theQueryExecutor
implements theQueryNamespaceProvider
trait, and the underlyingQueryDatabase
implementsQueryNamespace
. Satisfying those requirements allows the construction of aFlightServiceServer
from theservice_grpc_flight
crate.The
FlightServiceServer
is a gRPC server that can be served viatonic
at the API surface; however, enabling this required sometower::Service
wrangling. Theinfluxdb3_server/src/server.rs
module was introduced to house this code. The code there is largely inspired by this series of blog posts. The objective is to serve both gRPC (via the newly introducedtonic
server) and standard REST HTTP requests (via the existing HTTP server) on the same port.This is accomplished by the
HybridService
which can handle either gRPC or non-gRPC HTTP requests. TheHybridService
is wrapped in aHybridMakeService
which allows us to serve it viahyper::Server
on a single bind address.End-to-end tests were added in
influxdb3/tests/flight.rs
. These cover some basic FlightSQL cases. Acommon.rs
module was added that introduces some fixtures to aid in end-to-end tests ininfluxdb3
.Follow-on work
Authorizer
implementation for InfluxDB Edge #24681 to track work on that.influxdb3
integration test (auth.rs
)