-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix: Reuse KsqlClient instance for inter node requests #5742
fix: Reuse KsqlClient instance for inter node requests #5742
Conversation
How has the fix been tested? @purplefox in his PR said we should test with a long running pull query soak test. Moreover, can we add a unit test that issues a few pull and push queries and make sure that only a single ksql client is created? |
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.
LGTM, I also think we should do some kind of load test to make sure this fix works under load.
The original problem that this should fix manifests under a lot of concurrency (thousands of concurrent pull query requests) where some are forwarded to other nodes. A simple wrk test and dial up the concurrency should do: First reproduce the issue with ksqlDB built without this PR, then verify it's gone with this PR.
I'm not sure entirely how we could very easily verify that only one client is created in a unit test. That might get a little complex. From my human static analysis, I can see there's just one place in the code now that creates a
I'll do this manually to begin with. It might also be good to have a |
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.
LGTM
I ran many local tests, including using I have verified that with the change, I see no I still see some I'm going to merge this change. |
…5742) * Reuse ksqlClient between requests
Description
Fixes: #5600
Previously a new KsqlClient instance was being created for each inter node request (e.g. pull query forwarding). There is a KsqlClient constructor which takes a sharedClient instance but this was never being used in the production code path.
This PR does the following:
Each server now maintains a KsqlClient instance which is used for all inter node requests
The server's Vert.x instance is passed to the KsqlClient instance.
I'm completing this existing PR #5624
Testing done
Describe the testing strategy. Unit and integration tests are expected for any behavior changes.
Reviewer checklist