Skip to content

fix: honor disabled opened connection role verification - #721

Merged
sophia-bq merged 4 commits into
aws:mainfrom
pcbeingused333:fix/717-verify-none
Nov 27, 2026
Merged

sophia-bq merged 4 commits into
aws:mainfrom
pcbeingused333:fix/717-verify-none

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

Fixes #717

verifyOpenedConnectionType is declared but never read, so setting it to none still runs role queries on newly opened wrapper connections, including each pooled checkout. The initial connection strategy can add another role query when connecting to a known reader instance.

Read the existing option before the explicit getHostRole checks in the MySQL and PostgreSQL connect paths and the Aurora initial connection strategy's reader and writer paths. With none, these checks are skipped and the existing host metadata is retained. The default behavior, topology discovery, routing, and pool lifecycle remain unchanged.

The maintainer's November 5 response says the team will investigate. This patch addresses the narrower configuration bug reported in the issue; it does not introduce role caching or redesign the pool.

Testing and validation

Added regression tests for disabled verification in both clients and both Aurora instance-selection paths, with default client verification retained as a control. The tests use mocked connections and do not require AWS credentials or a database.

The new tests fail on main (4 cases) and pass with this change; the full unit suite (npm test) and npm run typecheck pass.

AI disclosure: This change and its regression tests were generated with Codex.

@pcbeingused333
pcbeingused333 requested a review from a team as a code owner November 12, 2026 06:23
@pcbeingused333

Copy link
Copy Markdown
Contributor Author

Friendly ping: could someone take a look at this when there's time? I'm happy to adjust anything. Thanks!

@sophia-bq sophia-bq left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for contributing this fix! I've added a few small comments as well as opened a draft PR with some changes on top of yours to address a similar unused property and add documentation (#727). I would really appreciate it if you would take a look at the docs there if you have the time :)

@sophia-bq
sophia-bq merged commit 97c8584 into aws:main Nov 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AwsMySQLPoolClient runs SELECT @@innodb_read_only twice before every query, and verifyOpenedConnectionType has no effect

2 participants