Repository navigation
Avoid aurora_version() probe on standard PostgreSQL - #51794
Merged
ahus1 merged 3 commits intoAug 24, 2026
Merged
Conversation
Query to_regproc('aurora_version') so Aurora detection does not
write ERROR to the PostgreSQL server log on every startup.
Closes keycloak#51792
Signed-off-by: Burak KALAYCI <kalayciburak1996@gmail.com>
kalayciburak
force-pushed
the
fix/51792-aurora-probe-no-pg-error
branch
from
August 18, 2026 12:10
1845008 to
4c1ff5e
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
model/jpa/src/main/java/org/keycloak/connections/jpa/AsyncCommitIntegrator.java:175
- The test plan reports
AsyncCommitIntegratorTest, but no such test is included in this PR, so the new probe's true/false result handling has no regression coverage. Please add the stated unit tests for both function-present and function-absent result sets.
static boolean auroraVersionFunctionExists(Connection connection) throws SQLException {
ahus1
reviewed
Aug 24, 2026
ahus1
previously approved these changes
Aug 24, 2026
ahus1
left a comment
Member
There was a problem hiding this comment.
Tested with an Aurora database, approving
…itIntegrator.java Signed-off-by: Alexander Schwartz <alexander.schwartz@gmx.net>
ahus1
force-pushed
the
fix/51792-aurora-probe-no-pg-error
branch
from
August 24, 2026 11:56
0b00006 to
af7d1f4
Compare
ahus1
approved these changes
Aug 24, 2026
ahus1
enabled auto-merge (squash)
August 24, 2026 11:56
Comment on lines
+175
to
+178
| static boolean auroraVersionFunctionExists(Connection connection) throws SQLException { | ||
| try (Statement stmt = connection.createStatement(); | ||
| ResultSet rs = stmt.executeQuery("SELECT to_regproc('pg_catalog.aurora_version') IS NOT NULL")) { | ||
| return rs.next() && rs.getBoolean(1); |
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.
Closes #51792
Since 26.7.0, Aurora detection runs
SELECT aurora_version()duringstartup. On standard PostgreSQL that function does not exist, so the
server logs
ERROR: function aurora_version() does not existeventhough Keycloak swallows the
SQLException.Probe with
SELECT to_regproc('aurora_version') IS NOT NULLinstead.Stock PostgreSQL returns false without an ERROR; Aurora still reports
the function as present.
Test plan
./mvnw -pl model/jpa -am test -Dtest=AsyncCommitIntegratorTest,JpaUtilsTest,JpaHashUtilsTest,KeyUtilsTestAsyncCommitIntegratorTest 2/2 (RED then GREEN); module tests 10/10 GREEN