Skip to content

Make target connection limits configurable - #1048

Open
subotac wants to merge 2 commits into
xataio:mainfrom
subotac:feat/configurable-target-connections
Open

Make target connection limits configurable#1048
subotac wants to merge 2 commits into
xataio:mainfrom
subotac:feat/configurable-target-connections

Conversation

@subotac

@subotac subotac commented Jul 28, 2026

Copy link
Copy Markdown

Description

Makes target PostgreSQL connection-pool limits configurable through target.postgres.max_connections and PGSTREAM_POSTGRES_WRITER_MAX_CONNECTIONS, while retaining the existing default of 50.

The target URL's pool_max_conns value is now honored when no explicit pgstream setting is provided. The resolved limit is applied to the writer and schema-observer pools, and the bulk-ingest COPY budget follows the writer-pool limit.

Related Issue(s)

Type of Change

  • New feature
  • Documentation update
  • Test coverage improvement

Changes Made

  • Added YAML and environment configuration for target pool limits.
  • Preserved URL configuration and defined explicit configuration precedence.
  • Added regression coverage for pool sizing and COPY-budget calculation.

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • Relevant package and non-integration test suites pass

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Code is well-commented
  • Documentation updated where necessary

Additional Notes

The race-enabled and Docker-backed suites were unavailable in the local Windows environment and will be covered by CI.

@github-actions

Copy link
Copy Markdown

Coverage

Total: 59.1% (+0.5% vs main)

Coverage in packages changed by this PR:

Package Coverage Δ
cmd/config 84.8% ±0.0%
internal/postgres 45.6% +2.6%
pkg/wal/processor/postgres 84.2% +4.3%

Comment thread cmd/config/config_env.go
@subotac
subotac requested a review from kvch July 29, 2026 21:26
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.

Make number of target connections configurable

2 participants