-
Notifications
You must be signed in to change notification settings - Fork 72
fix: use instance endpoint during monitoring connection status updates #429
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
Conversation
wrapper/src/main/java/software/amazon/jdbc/plugin/efm/MonitorImpl.java
Outdated
Show resolved
Hide resolved
92e5ac2 to
9076e43
Compare
| String instanceEndpoint = getInstanceEndpointPattern(host.getHost()); | ||
| String instanceEndpoint = rdsHelper.getInstanceEndpointPattern( | ||
| host.getHost(), | ||
| AuroraHostListProvider.CLUSTER_INSTANCE_HOST_PATTERN.getString(this.props)); |
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.
What if user configuration doesn't include Aurora host list provider?
| protected Set<String> aliases = ConcurrentHashMap.newKeySet(); | ||
| protected Set<String> allAliases = ConcurrentHashMap.newKeySet(); | ||
| protected long weight; // Greater or equal 0. Lesser the weight, the healthier node. | ||
| protected String ipAddress; |
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.
Probably we don't need it.
| try { | ||
| final HostSpec currentHostSpec = this.pluginService.getCurrentHostSpec(); | ||
| String monitoringEndpoint = null; | ||
| final RdsUrlType rdsUrlType = this.rdsHelper.identifyRdsType(monitoringEndpoint); |
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.
Qodana is right. You're passing null identifyRdsType()
| if (resultSet.next()) { | ||
| instanceName = resultSet.getString(1); | ||
| } | ||
| String instanceEndpoint = rdsHelper.getInstanceEndpointPattern( |
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.
Can we use topology to search for an instance details?
Summary
If the initial connection is established using an cluster endpoint, use an instance endpoint when verifying connection in EFM plugin or fallback to the IP address.
Description
Integration Test Run: https://github.com/Bit-Quill/aws-advanced-jdbc-wrapper/actions/runs/4878286818
Before
After
Additional Reviewers
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.