Skip to content

Add configurable CCDB connection parameters#5260

Open
WeiQuan0605 wants to merge 1 commit into
cloudfoundry:mainfrom
sap-contributions:add-configurable-ccdb-connection-parameters
Open

Add configurable CCDB connection parameters#5260
WeiQuan0605 wants to merge 1 commit into
cloudfoundry:mainfrom
sap-contributions:add-configurable-ccdb-connection-parameters

Conversation

@WeiQuan0605

@WeiQuan0605 WeiQuan0605 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor
  • A short explanation of the proposed change:

    Adds support for a connection_parameters hash in the CC config that allows operators to configure PostgreSQL connection settings per-connection
    SQL session parameters (statement_timeout, idle_in_transaction_session_timeout) are applied via Sequel's connect_sqls on every new DB connection
    libpq TCP keepalive parameters (keepalives, keepalives_idle, keepalives_interval, keepalives_count) are merged directly into the Sequel connection options

  • An explanation of the use cases your change solves
    Currently CC relies on connection timeouts configured globally at the CCDB level (e.g. statement_timeout = 1h, idle_in_transaction_session_timeout = 10min). This works but requires DB-level access to change. This feature allows these same settings to be configured from the BOSH manifest, so they can be managed alongside other CC configuration without requiring direct DB access.

    Typical use case: set statement_timeout and idle_in_transaction_session_timeout to match or reinforce the DB-level defaults, and configure TCP keepalives (keepalives, keepalives_idle, keepalives_interval, keepalives_count) to detect dead connections.

  • Links to any other associated PRs

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

Allow operators to pass a connection_parameters hash in the BOSH manifest
to configure PostgreSQL connection settings per-connection.

SQL session params (statement_timeout, idle_in_transaction_session_timeout)
are applied via Sequel's connect_sqls on every new DB connection. libpq TCP
keepalive params (keepalives, keepalives_idle, keepalives_interval,
keepalives_count) are merged directly into the Sequel connection options.

Added optional(:connection_parameters) => Hash to both api_schema.rb
and worker_schema.rb.
@WeiQuan0605 WeiQuan0605 force-pushed the add-configurable-ccdb-connection-parameters branch from 51d1b5b to d0b32b5 Compare July 3, 2026 09:17
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.

1 participant