Skip to content

feat: make platform db connection pooling configurable#2730

Merged
merll merged 44 commits intomainfrom
APL-1291
Dec 2, 2025
Merged

feat: make platform db connection pooling configurable#2730
merll merged 44 commits intomainfrom
APL-1291

Conversation

@merll
Copy link
Contributor

@merll merll commented Nov 19, 2025

📌 Summary

This PR replaces hard-coded PostgreSQL parameters with platform values, which are identically set by default, but can be updated by the platform admin. Platform applications using PostgreSQL databases, i.e. Gitea, Keycloak, and Harbor also have the hard-coded connection pool settings replaced with variables. However, the defaults of maximum database connections on the app-side are reduced, for taking a deduction from the database max_connections into account.
The default for superuser_reserved_connections of 3. This has lead to Harbor not starting, when it was attempting to max out the connection pool.

The max connections on the app-side is set to 28, considering the default of superuser_reserved_connections plus one in case there are other maintenance connections. A backport for current releases, which does not involve schema changes, and just updates the hard-coded defaults, is published in #2731.

Other changes to the schema are fixes of wrong locations or cleanups of unused values. In addition it showed that values introduced for each database's backupSidecarResources were not applied in the template. This has been added here.

🔍 Reviewer Notes

When upgrading to this feature branch, defaults should be added to the values repo. Changes are expected to require restarting the application pods, but not the databases as default settings are identical to current hard-coded parameters.

Note also when upgrading from main, you need to set specVersion in env/settings/versions.yaml back to 44 for re-running schema migrations. Otherwise validations fail.

🧹 Checklist

  • Code is readable, maintainable, and robust.
  • Unit tests added/updated

@merll merll changed the title Apl 1291 feat: make platform db connection pooling configurable Nov 19, 2025
@merll merll changed the title feat: make platform db connection pooling configurable fix: make platform db connection pooling configurable Nov 19, 2025
@merll merll changed the title fix: make platform db connection pooling configurable feat: make platform db connection pooling configurable Nov 19, 2025
@ElderMatt ElderMatt self-assigned this Nov 21, 2025
@ElderMatt
Copy link
Contributor

I think all the test files can be removed.

@ElderMatt ElderMatt self-requested a review December 1, 2025 10:21
@merll merll merged commit 41187a2 into main Dec 2, 2025
11 checks passed
@merll merll deleted the APL-1291 branch December 2, 2025 09:23
Ani1357 pushed a commit that referenced this pull request Jan 6, 2026
Co-authored-by: svcAPLBot <174728082+svcAPLBot@users.noreply.github.com>
(cherry picked from commit 41187a2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants