fix(pg): map DatabaseCluster proxy.config to PerconaPgCluster pgBouncer.config#923
fix(pg): map DatabaseCluster proxy.config to PerconaPgCluster pgBouncer.config#923pvstekunov wants to merge 1 commit intoopeneverest:mainfrom
Conversation
…er.config - Add ParsePGBouncerConfig to parse spec.proxy.config YAML into PGBouncerConfiguration (global, databases, users). - In pg applier Proxy(), set pg.Spec.Proxy.PGBouncer.Config when database.Spec.Proxy.Config is non-empty. - Add unit tests for the parser. Fixes openeverest/openeverest#1823
chilagrow
left a comment
There was a problem hiding this comment.
Thanks for the contribution @pvstekunov 🤗
While the suggested change in openeverest-operator is sufficient for updating DatabaseCluster CR directly, changes then made on .spec.proxy by OpenEverest UI reverts and removes .spec.proxy.config silently. Which makes adding config support for pgBouncer much bigger change, requiring OpenEverest UI to support the field as well.
Let us think of any other necessary changes required for making pgBouncer config available.
|
Can you just ignore spec.proxy.config section during reconciling? Then I can create database cluster using percona everest and customize it on PerconaPgCluster level like it had been in 1.9.0 version? |
That would prevent spec.proxy.config from being silently removed. A concern with this approach is that it would add a field that is not visible in OpenEverest UI or update it, making UI not reflect the underlying field of CR. Additionally
This is interesting, I was not aware, does this mean you've been able to configure |
|
Yes. |
|
Hi @pvstekunov, I found the commit which addresses the change in the behaviour e25a831. It was added in 1.10.0. Reading the context in https://perconadev.atlassian.net/browse/EVEREST-2023, the very reason this fix was made is because if a parameter disappeared from I don't think reverting the change made in 1.10.0 is ideal this case. |
|
Thanks for info. Is there any way how to configure pgbouncer on PerconaPgCluster under control of everest 1.12/1.13? |
|
@pvstekunov for 1.12/1.13 versions, unfortunately I can't think of how |
Description
DatabaseCluster.spec.proxy.configwas not being propagated toPerconaPgCluster.spec.proxy.pgBouncer.config, so custom pgBouncer settings (e.g.default_pool_size,max_client_conn,client_tls_sslmode) were lost during reconciliation.Changes
pgbouncer_config.go: AddParsePGBouncerConfigto parsespec.proxy.configYAML intoPGBouncerConfiguration(global,databases,users).applier.go: InProxy(), setpg.Spec.Proxy.PGBouncer.Configwhendatabase.Spec.Proxy.Configis non-empty.pgbouncer_config_test.go: Unit tests for the parser (empty, whitespace, global section, numeric values, invalid YAML).Example
This config is now correctly applied to the underlying PerconaPgCluster.
Testing
go test ./internal/controller/everest/providers/pg/...— all passgo build ./...— succeedsFixes openeverest/openeverest#1823