Skip to content

feat: role-specific pool configuration - #1306

Open
levkk wants to merge 5 commits into
mainfrom
levkk-replica-pool-size
Open

feat: role-specific pool configuration#1306
levkk wants to merge 5 commits into
mainfrom
levkk-replica-pool-size

Conversation

@levkk

@levkk levkk commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Feature description

Implement role-specific configuration for connection pools.

Example:

[[users]]
name = "pgdog"
database = "prod"
pool_size_replica = 10
pool_size_primary = 25

[[databases]]
name = "prod"
host = "10.0.0.0"
pool_size_replica = 25

This allows for replica and primary connection pools in the same cluster to have different settings. Just like all other settings, user values take priority over database values.

Notes

Pools are now role-aware. The role is propagated down from the load balancer to the pool, so the pool is mutated by the load balancer. If the pool is created differently, that mutation doesn't take place, and the pool role will not be set correctly. This is expected, since pool roles only make sense in the context of the load balancer.

Cleanup

  • Removed dead code in pool::Config
  • Removed redundant accessors in pool::Config
  • Moved load balancer atomic role into its own struct

Related issue

Fixes #1295.

@levkk
levkk requested a review from meskill August 4, 2026 04:53
@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.91358% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pgdog/src/backend/pool/config.rs 88.09% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

@levkk
levkk marked this pull request as ready for review August 4, 2026 04:55
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.

Add the ability to configure replica/primary pool settings on the user

1 participant