Skip to content

feat: make DB Statement for health check configurable#3731

Open
tack-sap wants to merge 1 commit intodevelopfrom
feat/dbHealthzStatementConfigurable
Open

feat: make DB Statement for health check configurable#3731
tack-sap wants to merge 1 commit intodevelopfrom
feat/dbHealthzStatementConfigurable

Conversation

@tack-sap
Copy link
Contributor

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.

@duanemay
Copy link
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants