From f553bc13bea3cb9abced7f73ff43bbf6caf29ed0 Mon Sep 17 00:00:00 2001 From: Maciek Sakrejda Date: Fri, 12 Jul 2024 13:47:56 -0700 Subject: [PATCH] Fix DISABLE_CITUS_SCHEMA_STATS config reading The changes in #562 missed that the updated config-reading code was only for config read from environment variables. Config from the config file was not pre-processed, so any currently-documented values of disable_citus_schema_stats specified there would be ignored, and relation and index stats would always be collected. Config specified via individual environment variables worked as expected. Since the new buggy behavior of the setting is not yet in a released version, and not yet documented, it does not need a CHANGELOG entry. --- config/read.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/read.go b/config/read.go index 166f0ec98..56df99022 100644 --- a/config/read.go +++ b/config/read.go @@ -305,7 +305,7 @@ func getDefaultConfig() *ServerConfig { config.AlwaysCollectSystemData = parseConfigBool(alwaysCollectSystemData) } if disableCitusSchemaStats := os.Getenv("DISABLE_CITUS_SCHEMA_STATS"); disableCitusSchemaStats != "" { - config.DisableCitusSchemaStats = parseConfigDisableCitusSchemaStats(disableCitusSchemaStats) + config.DisableCitusSchemaStats = disableCitusSchemaStats } if logPgReadFile := os.Getenv("LOG_PG_READ_FILE"); logPgReadFile != "" { config.LogPgReadFile = parseConfigBool(logPgReadFile) @@ -705,6 +705,10 @@ func preprocessConfig(config *ServerConfig) (*ServerConfig, error) { } } + if config.DisableCitusSchemaStats != "" { + config.DisableCitusSchemaStats = parseConfigDisableCitusSchemaStats(config.DisableCitusSchemaStats) + } + return config, nil }