-
Notifications
You must be signed in to change notification settings - Fork 58
feat: endpoint plugin #971
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
Merged
aaronchung-bitquill
merged 25 commits into
aws:main
from
Bit-Quill:feat/endpoint-plugin
Aug 15, 2024
Merged
feat: endpoint plugin #971
aaronchung-bitquill
merged 25 commits into
aws:main
from
Bit-Quill:feat/endpoint-plugin
Aug 15, 2024
+1,944
−40
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7897f9c
to
afbcdce
Compare
karenc-bq
reviewed
May 1, 2024
wrapper/src/main/java/software/amazon/jdbc/ConnectionPluginManager.java
Outdated
Show resolved
Hide resolved
80ca295
to
36c6202
Compare
examples/AWSDriverExample/src/main/java/software/amazon/DatasourceExample.java
Outdated
Show resolved
Hide resolved
sergiyvamz
reviewed
May 21, 2024
wrapper/src/main/java/software/amazon/jdbc/ConnectionPluginChainBuilder.java
Outdated
Show resolved
Hide resolved
sergiyvamz
reviewed
May 21, 2024
sergiyvamz
reviewed
May 21, 2024
...per/src/main/java/software/amazon/jdbc/hostlistprovider/RdsMultiAzDbClusterListProvider.java
Outdated
Show resolved
Hide resolved
sergiyvamz
reviewed
May 21, 2024
wrapper/src/main/java/software/amazon/jdbc/plugin/endpoint/EndpointServiceImpl.java
Outdated
Show resolved
Hide resolved
sergiyvamz
reviewed
May 21, 2024
wrapper/src/main/java/software/amazon/jdbc/plugin/endpoint/EndpointMonitor.java
Outdated
Show resolved
Hide resolved
sergiyvamz
reviewed
May 21, 2024
wrapper/src/main/java/software/amazon/jdbc/plugin/endpoint/EndpointMonitor.java
Outdated
Show resolved
Hide resolved
f29ebdc
to
e2f74fb
Compare
259f386
to
360db22
Compare
cd7ea1b
to
c311548
Compare
a137448
to
680cfa7
Compare
9a08328
to
f77233a
Compare
brunos-bq
reviewed
Jul 25, 2024
docs/using-the-jdbc-driver/using-plugins/UsingTheLimitlessConnectionPlugin.md
Outdated
Show resolved
Hide resolved
docs/using-the-jdbc-driver/using-plugins/UsingTheLimitlessConnectionPlugin.md
Show resolved
Hide resolved
docs/using-the-jdbc-driver/using-plugins/UsingTheLimitlessConnectionPlugin.md
Outdated
Show resolved
Hide resolved
docs/using-the-jdbc-driver/using-plugins/UsingTheLimitlessConnectionPlugin.md
Outdated
Show resolved
Hide resolved
docs/using-the-jdbc-driver/using-plugins/UsingTheLimitlessConnectionPlugin.md
Outdated
Show resolved
Hide resolved
docs/using-the-jdbc-driver/using-plugins/UsingTheLimitlessConnectionPlugin.md
Show resolved
Hide resolved
docs/using-the-jdbc-driver/using-plugins/UsingTheLimitlessConnectionPlugin.md
Show resolved
Hide resolved
docs/using-the-jdbc-driver/using-plugins/UsingTheLimitlessConnectionPlugin.md
Outdated
Show resolved
Hide resolved
docs/using-the-jdbc-driver/using-plugins/UsingTheLimitlessConnectionPlugin.md
Outdated
Show resolved
Hide resolved
docs/using-the-jdbc-driver/using-plugins/UsingTheLimitlessConnectionPlugin.md
Outdated
Show resolved
Hide resolved
docs/using-the-jdbc-driver/using-plugins/UsingTheLimitlessConnectionPlugin.md
Outdated
Show resolved
Hide resolved
karenc-bq
reviewed
Jul 26, 2024
examples/AWSDriverExample/src/main/java/software/amazon/EndpointPluginExample.java
Outdated
Show resolved
Hide resolved
karenc-bq
reviewed
Aug 13, 2024
examples/AWSDriverExample/src/main/java/software/amazon/LimitlessPostgresqlExample.java
Show resolved
Hide resolved
karenc-bq
reviewed
Aug 13, 2024
examples/AWSDriverExample/src/main/java/software/amazon/LimitlessPostgresqlExample.java
Show resolved
Hide resolved
…on cache map in case of multiple clusters
…ntimexception rethrowing
…nd remove unused property
…th changes to allow resetting host weights
…upThread to ensure cleanupThread is not initialized twice
…valid router loud values
984d560
to
fab46b0
Compare
sergiyvamz
approved these changes
Aug 15, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Aurora Limitless Database is a sharded database. It has a DB Shard Group that contains multiple transaction routers that clients are ultimately routed to interact with.
This PR introduces a new plugin that put simply, does client side load balancing whilst connecting to an Aurora Limitless Database.
The plugin does this by polling an API for available transaction routers and their load levels, caching this info, and then choosing which transaction router to connect to based on the load info.
Description
The overall architecture is very similar to the EFM plugin. To poll for available transaction routers and their load levels, there is a
LimitlessRouterMonitor
class and its accompanying monitor service classLimitlessRouterService
class.To choose hosts, there are modifications to the
RoundRobinHostSelector
strategy, and a newHighestWeightHostSelector
strategy class.The
LimitlessConnectionPlugin
uses theRoundRobinHostSelector
strategy with weights to select which Transaction Router to connect to. The weights are essentially the inverse of the transaction routers load. So a more loaded transaction router will be selected less, and a less loaded transaction router will be selected more. Modifications to theRoundRobinHostSelector
strategy are to allow cached weights to be cleared when there is a change in hosts or weights.In the case the selected transaction router is down and the driver fails to connect to it, the plugin has connection retry logic. It will mark the last selected router as
UNAVAILABLE
, then select another transaction router to connect to based on load using the newHighestWeightHostSelector
strategy. It will continue to select and try to connect to the highest weight available router until a successful connection is made, or until the max attempts are reached.Additional Reviewers
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.