Skip to content

Conversation

@bgrainger
Copy link
Contributor

@bgrainger bgrainger commented Nov 17, 2023

What this PR does / why we need it:
The previous default behavior for the MySQL health check was to execute SELECT 1;. This is fairly heavyweight; it would be more efficient to send a MySQL "ping" packet, which is a binary test of server health. MySqlHealthCheckOptions.CommandText now defaults to null, meaning "ping the server". Users can opt in to setting a command that will be executed on the server, but the default is now a more efficient ping.

Which issue(s) this PR fixes:
Fixes #2031

Please reference the issue this PR will close: #2031

Special notes for your reviewer:

Does this PR introduce a user-facing change?:
Yes; it makes MySqlHealthCheckOptions.CommandText nullable and changes its default value; it also makes the healthQuery parameter to AddMySql nullable and changes its default value to null.

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Unit tests passing
  • End-to-end tests passing
  • Extended the documentation
  • Provided sample for the feature

@github-actions github-actions bot added the mysql label Nov 17, 2023
@bgrainger bgrainger marked this pull request as draft November 17, 2023 15:10
Users can opt in to setting a command that will be executed on the server, but the default is now a more efficient ping.
@bgrainger bgrainger marked this pull request as ready for review November 18, 2023 15:52
@adamsitnik
Copy link
Collaborator

The fix got included in #2096

@adamsitnik adamsitnik closed this Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MySql check no longer uses Ping

2 participants