Skip to content

feat: omit explicit DB Statement for health check #3731

Merged
fhanik merged 2 commits intodevelopfrom
feat/dbHealthzStatementConfigurable
Apr 21, 2026
Merged

feat: omit explicit DB Statement for health check #3731
fhanik merged 2 commits intodevelopfrom
feat/dbHealthzStatementConfigurable

Conversation

@tack-sap
Copy link
Copy Markdown
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
Copy Markdown
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.

@tack-sap tack-sap changed the title feat: make DB Statement for health check configurable feat: omit explicit DB Statement for health check Apr 13, 2026
@tack-sap
Copy link
Copy Markdown
Contributor Author

@fhanik @duanemay As discussed I changed the implementation to rely on the validationQuery and testOnBorrow configuration of the DataSource. Hence the statement in the HealthzEndpoint is no longer needed and we only establish a connection to check the database.

@github-project-automation github-project-automation Bot moved this from Inbox to Pending Merge | Prioritized in Foundational Infrastructure Working Group Apr 13, 2026
@fhanik fhanik merged commit 28237f8 into develop Apr 21, 2026
28 of 29 checks passed
@github-project-automation github-project-automation Bot moved this from Pending Merge | Prioritized to Done in Foundational Infrastructure Working Group Apr 21, 2026
@fhanik fhanik deleted the feat/dbHealthzStatementConfigurable branch April 21, 2026 21:18
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.

4 participants