Skip to content

Commit

Permalink
chore: remove ignore_startup_parameters from config
Browse files Browse the repository at this point in the history
  • Loading branch information
sweatybridge committed Aug 17, 2023
1 parent 95b05b1 commit a008154
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
2 changes: 0 additions & 2 deletions internal/link/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,13 @@ func linkPooler(ctx context.Context, projectRef string) error {
func updatePoolerConfig(config api.ProjectPgBouncerConfig) {
copy := utils.Config.Db.Pooler
copy.PoolMode = utils.PoolMode(config.PoolMode)
copy.IgnoreStartupParameters = readCsv(config.IgnoreStartupParameters)
if config.DefaultPoolSize != nil {
copy.DefaultPoolSize = uint(*config.DefaultPoolSize)
}
if config.MaxClientConn != nil {
copy.MaxClientConn = uint(*config.MaxClientConn)
}
changed := utils.Config.Db.Pooler.PoolMode != copy.PoolMode ||
!utils.SliceEqual(utils.Config.Db.Pooler.IgnoreStartupParameters, copy.IgnoreStartupParameters) ||
utils.Config.Db.Pooler.DefaultPoolSize != copy.DefaultPoolSize ||
utils.Config.Db.Pooler.MaxClientConn != copy.MaxClientConn
if changed {
Expand Down
3 changes: 2 additions & 1 deletion internal/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -767,9 +767,10 @@ EOF
fmt.Sprintf("POSTGRESQL_PORT=%d", dbConfig.Port),
"POSTGRESQL_PASSWORD=" + dbConfig.Password,
fmt.Sprintf("PGBOUNCER_POOL_MODE=%s", utils.Config.Db.Pooler.PoolMode),
fmt.Sprintf("PGBOUNCER_IGNORE_STARTUP_PARAMETERS=%s", strings.Join(utils.Config.Db.Pooler.IgnoreStartupParameters, ",")),
fmt.Sprintf("PGBOUNCER_DEFAULT_POOL_SIZE=%d", utils.Config.Db.Pooler.DefaultPoolSize),
fmt.Sprintf("PGBOUNCER_MAX_CLIENT_CONN=%d", utils.Config.Db.Pooler.MaxClientConn),
// Default platform config: https://github.com/supabase/postgres/blob/develop/ansible/files/pgbouncer_config/pgbouncer.ini.j2
"PGBOUNCER_IGNORE_STARTUP_PARAMETERS=extra_float_digits",
},
Healthcheck: &container.HealthConfig{
Test: []string{"CMD", "bash", "-c", "printf \\0 > /dev/tcp/localhost/6432"},
Expand Down
11 changes: 5 additions & 6 deletions internal/utils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,11 @@ type (
}

pooler struct {
Enabled bool `toml:"enabled"`
Port uint16 `toml:"port"`
PoolMode PoolMode `toml:"pool_mode"`
DefaultPoolSize uint `toml:"default_pool_size"`
IgnoreStartupParameters []string `toml:"ignore_startup_parameters"`
MaxClientConn uint `toml:"max_client_conn"`
Enabled bool `toml:"enabled"`
Port uint16 `toml:"port"`
PoolMode PoolMode `toml:"pool_mode"`
DefaultPoolSize uint `toml:"default_pool_size"`
MaxClientConn uint `toml:"max_client_conn"`
}

studio struct {
Expand Down
1 change: 0 additions & 1 deletion internal/utils/templates/init_config.test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ enabled = true
port = 54329
pool_mode = "transaction"
default_pool_size = 20
ignore_startup_parameters = ["extra_float_digits"]
max_client_conn = 100

[studio]
Expand Down
1 change: 0 additions & 1 deletion internal/utils/templates/init_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ enabled = false
port = 54329
pool_mode = "transaction"
default_pool_size = 20
ignore_startup_parameters = ["extra_float_digits"]
max_client_conn = 100

[studio]
Expand Down

0 comments on commit a008154

Please sign in to comment.