feat: make DB Statement for health check configurable#3731
Open
feat: make DB Statement for health check configurable#3731
Conversation
Member
|
As discussed there is already a validationQuery in org.cloudfoundry.identity.uaa.db.DatabasePlatform, which is used in the datasource when getting a connection. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With #2718 and #2763 we introduced an (asynchronous) check to the Database via a simple query to the health check of the UAA. As HSQLDB does not support the simple query "SELECT 1;" we used "SELECT 1 from identity_zone;" as the query that is executed in the health check. Usually this is still simple enough and it remains to be a good choice as default statement.
However in some specific scenarios this statement produces too much work for a simple health check. Especially in an environment with a lot of identity_zones and many uaa instances that do such a health check in regular interval, we saw that it produces unnecessary load on the database.
To avoid this unnecessary load on the database, we would like to make the statement that is used for the health check of the DB configurable with this PR. The default will stay the same, as this statement will work on all supported vendors. But for scenarios where you don't want this default statement, you have the possibility to change the statement to whatever suits your needs better. The property shares the same prefix as the rate of the DB checks, so you have both configurations in the same place.