Skip to content

Connecting to non-aurora databases requires disabling auroraConnectionTracker #1841

@tcbcw

Description

@tcbcw

Describe the bug

We ran into a behavior change in 3.3.0. When using the wrapper on non-aurora databases, we must now explicitly disable the auroraConnectionTracker. Previously, it would work on aurora and non-aurora databases.

  • Version: Regression introduced in 3.3.0 (worked in 3.2.0)
  • Description: AuroraConnectionTrackerPlugin throws SQLException: An error occurred while obtaining the connections host ID on connect when using a non-Aurora database
  • Root cause: PluginServiceImpl.identifyConnection was refactored in PR refactor: get host role #1684 to call dialect.getHostId(connection) and throw if it returns null, instead of returning null gracefully as it did in 3.2.0
  • Workaround: Exclude auroraConnectionTracker from wrapperPlugins

Expected Behavior

Our code runs against both Aurora and non-aurora databases. We would prefer the old way where we didn't have to explicitly disable the plugin for non-aurora dbs. This change requires us to know if we are on aurora or not.

What plugins are used? What other connection properties were set?

AuroraConnectionTrackerPlugin

Current Behavior

PluginServiceImpl.identifyConnection was refactored in PR #1684 to call dialect.getHostId(connection) and throw if it returns null, instead of returning null gracefully as it did in 3.2.0

Reproduction Steps

Connect to aurora, it works.
Connect to non-aurora with the same connection settings, it fails.

Possible Solution

No response

Additional Information/Context

No response

The AWS Advanced JDBC Wrapper version used

3.3.0

JDK version used

21

Operating System and version

Ubuntu 22.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions