-
Notifications
You must be signed in to change notification settings - Fork 72
refactor: use monitoring RdsHostListProvider by default #1636
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Sophia Chu <112967780+sophia-bq@users.noreply.github.com>
This reverts commit 438ab14.
| @EnableOnTestFeature(TestEnvironmentFeatures.NETWORK_OUTAGES_ENABLED) | ||
| @EnableOnNumOfInstances(min = 2) | ||
| // Multi-AZ tests already simulate this in other tests instead of sending server failover requests. | ||
| @EnableOnDatabaseEngineDeployment(DatabaseEngineDeployment.AURORA) |
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 test passes on multi-AZ now
| if (conn == null) { | ||
| // We cannot fetch the latest topology since we do not have access to a connection, so we return the original | ||
| // hosts parsed from the connection string. | ||
| if (!this.pluginService.isDialectConfirmed()) { |
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 needed because without it, cluster topology monitors are created before the db dialect has been updated. This causes errors because the queries that the topology monitors execute are not aligned with the actual database dialect
wrapper/src/main/java/software/amazon/jdbc/hostlistprovider/RdsHostListProvider.java
Outdated
Show resolved
Hide resolved
...er/src/main/java/software/amazon/jdbc/hostlistprovider/ConnectionStringHostListProvider.java
Show resolved
Hide resolved
wrapper/src/main/java/software/amazon/jdbc/hostlistprovider/DynamicHostListProvider.java
Outdated
Show resolved
Hide resolved
wrapper/src/main/java/software/amazon/jdbc/hostlistprovider/RdsHostListProvider.java
Outdated
Show resolved
Hide resolved
...r/src/main/java/software/amazon/jdbc/hostlistprovider/monitoring/ClusterTopologyMonitor.java
Outdated
Show resolved
Hide resolved
...er/src/main/java/software/amazon/jdbc/plugin/failover/ClusterAwareWriterFailoverHandler.java
Outdated
Show resolved
Hide resolved
wrapper/src/main/java/software/amazon/jdbc/hostlistprovider/RdsHostListProvider.java
Outdated
Show resolved
Hide resolved
wrapper/src/main/java/software/amazon/jdbc/hostlistprovider/RdsHostListProvider.java
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| protected ClusterTopologyMonitor getOrCreateMonitor() throws SQLException { | ||
| ClusterTopologyMonitor monitor = this.servicesContainer.getMonitorService() |
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.
monitor is unused.
| return this.topologyUtils.queryForTopology(conn, initialHostSpec, this.instanceTemplate); | ||
| } | ||
|
|
||
| protected List<HostSpec> getFreshTopology(boolean shouldVerifyWriter, long timeoutMs) throws SQLException { |
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.
boolean shouldVerifyWriter, long timeoutMs - not in use
This PR removes the old non-monitoring RdsHostListProvider so that the default HostListProvider is a monitoring one.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.