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

feat: Adds Scalable Push Query Routing #7587

Merged

Conversation

AlanConfluent
Copy link
Member

Description

The next step of scalable push queries, this adds the routing logic in PushRouting.

At the moment, it attempts to determine the set of hosts at start time to connect to and just sticks with them. A followup change will fail the query if there's a rebalance.

PushRouting does everything async, meaning that it uses the Vertx Context and CompletableFutures to handle everything, so it doesn't require a thread pool.

This also introduces a http2 client to KsqlClient since this is required to issue http2 requests, which this now does for the /query-stream requests between cluster instances.

Testing done

Ran unit tests.

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

@AlanConfluent AlanConfluent requested a review from a team as a code owner May 26, 2021 00:29
Copy link
Member

@vvcephei vvcephei 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 this, @AlanConfluent ! Within my limitations, this change looks good. I was puzzled by one thing, though (inline).

@@ -66,6 +68,7 @@
private static final String STATUS_PATH = "/status";
private static final String KSQL_PATH = "/ksql";
private static final String QUERY_PATH = "/query";
private static final String QUERY_STREAM_PATH = "/query-stream";
Copy link
Member

Choose a reason for hiding this comment

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

What's up with this? We have had to handle transient queries for a long time, so I'm not seeing how this could have been missing.

Copy link
Member Author

Choose a reason for hiding this comment

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

/query is the http 1.1 path, handled by StreamedQueryResource. This is the endpoint we want to eventually deprecate. It's what's currently handling queries for the other methods of KsqlTarget. I've added a new method which uses the new endpoint /query-stream which has the benefit of not using the threadpool and being fully async.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, yeah, I was just surprised that we're not already using the async endpoint.

@AlanConfluent AlanConfluent merged commit 278a261 into confluentinc:master Jun 2, 2021
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.

3 participants