diff --git a/docs/en/sql-reference/dictionaries/index.md b/docs/en/sql-reference/dictionaries/index.md index ff01bbb071a..60f00840042 100644 --- a/docs/en/sql-reference/dictionaries/index.md +++ b/docs/en/sql-reference/dictionaries/index.md @@ -1286,7 +1286,7 @@ Setting fields: - `table` – Name of the table and schema if exists. - `connection_string` – Connection string. - `invalidate_query` – Query for checking the dictionary status. Optional parameter. Read more in the section [Refreshing dictionary data using LIFETIME](#refreshing-dictionary-data-using-lifetime). -- `bg_reconnect` – Reconnect to replica in background if connection fails. Optional parameter. +- `background_reconnect` – Reconnect to replica in background if connection fails. Optional parameter. - `query` – The custom query. Optional parameter. :::note @@ -1878,7 +1878,7 @@ Setting fields: - `table` – Name of the table. - `where` – The selection criteria. The syntax for conditions is the same as for `WHERE` clause in PostgreSQL. For example, `id > 10 AND id < 20`. Optional parameter. - `invalidate_query` – Query for checking the dictionary status. Optional parameter. Read more in the section [Refreshing dictionary data using LIFETIME](#refreshing-dictionary-data-using-lifetime). -- `bg_reconnect` – Reconnect to replica in background if connection fails. Optional parameter. +- `background_reconnect` – Reconnect to replica in background if connection fails. Optional parameter. - `query` – The custom query. Optional parameter. :::note diff --git a/src/Common/mysqlxx/PoolWithFailover.cpp b/src/Common/mysqlxx/PoolWithFailover.cpp index ab55a03a243..051c177e7b7 100644 --- a/src/Common/mysqlxx/PoolWithFailover.cpp +++ b/src/Common/mysqlxx/PoolWithFailover.cpp @@ -58,7 +58,7 @@ PoolWithFailover::PoolWithFailover( : max_tries(max_tries_) , shareable(config_.getBool(config_name_ + ".share_connection", false)) , wait_timeout(UINT64_MAX) - , bg_reconnect(config_.getBool(config_name_ + ".bg_reconnect", false)) + , bg_reconnect(config_.getBool(config_name_ + ".background_reconnect", false)) { if (config_.has(config_name_ + ".replica")) { diff --git a/src/Core/ServerSettings.cpp b/src/Core/ServerSettings.cpp index 071b028a0a1..6f03310ec28 100644 --- a/src/Core/ServerSettings.cpp +++ b/src/Core/ServerSettings.cpp @@ -27,7 +27,7 @@ namespace DB { #define LIST_OF_SERVER_SETTINGS(DECLARE, ALIAS) \ - DECLARE(UInt64, bg_reconnect_mysql_dict_interval, 1000, "Interval in milliseconds for reconnection attempts of failed MySQL and Postgres dictionaries having `bg_reconnect` enabled.", 0) \ + DECLARE(UInt64, bg_reconnect_mysql_dict_interval, 1000, "Interval in milliseconds for reconnection attempts of failed MySQL and Postgres dictionaries having `background_reconnect` enabled.", 0) \ DECLARE(Bool, show_addresses_in_stack_traces, true, "If it is set true will show addresses in stack traces", 0) \ DECLARE(Bool, shutdown_wait_unfinished_queries, false, "If set true ClickHouse will wait for running queries finish before shutdown.", 0) \ DECLARE(UInt64, shutdown_wait_unfinished, 5, "Delay in seconds to wait for unfinished queries", 0) \ diff --git a/src/Dictionaries/MySQLDictionarySource.cpp b/src/Dictionaries/MySQLDictionarySource.cpp index dff787bef02..4fc0bbcbd1a 100644 --- a/src/Dictionaries/MySQLDictionarySource.cpp +++ b/src/Dictionaries/MySQLDictionarySource.cpp @@ -119,7 +119,7 @@ void registerDictionarySourceMysql(DictionarySourceFactory & factory) .update_field = named_collection->getOrDefault("update_field", ""), .update_lag = named_collection->getOrDefault("update_lag", 1), .dont_check_update_time = named_collection->getOrDefault("dont_check_update_time", false), - .bg_reconnect = named_collection->getOrDefault("bg_reconnect", false), + .bg_reconnect = named_collection->getOrDefault("background_reconnect", false), }); const auto & settings = global_context->getSettingsRef(); @@ -149,7 +149,7 @@ void registerDictionarySourceMysql(DictionarySourceFactory & factory) .update_field = config.getString(settings_config_prefix + ".update_field", ""), .update_lag = config.getUInt64(settings_config_prefix + ".update_lag", 1), .dont_check_update_time = config.getBool(settings_config_prefix + ".dont_check_update_time", false), - .bg_reconnect = config.getBool(settings_config_prefix + ".bg_reconnect", false), + .bg_reconnect = config.getBool(settings_config_prefix + ".background_reconnect", false), }); pool = std::make_shared( diff --git a/src/Dictionaries/PostgreSQLDictionarySource.cpp b/src/Dictionaries/PostgreSQLDictionarySource.cpp index f5a5b61330c..6735072bd82 100644 --- a/src/Dictionaries/PostgreSQLDictionarySource.cpp +++ b/src/Dictionaries/PostgreSQLDictionarySource.cpp @@ -37,7 +37,7 @@ namespace ErrorCodes } static const ValidateKeysMultiset dictionary_allowed_keys = { - "host", "port", "user", "password", "db", "database", "table", "schema", "bg_reconnect", + "host", "port", "user", "password", "db", "database", "table", "schema", "background_reconnect", "update_field", "update_lag", "invalidate_query", "query", "where", "name", "priority"}; #if USE_LIBPQXX @@ -244,7 +244,7 @@ void registerDictionarySourcePostgreSQL(DictionarySourceFactory & factory) .update_lag = named_collection->getOrDefault("update_lag", 1), }); - bg_reconnect = named_collection->getOrDefault("bg_reconnect", false); + bg_reconnect = named_collection->getOrDefault("background_reconnect", false); replicas_by_priority[0].emplace_back(common_configuration); } @@ -273,7 +273,7 @@ void registerDictionarySourcePostgreSQL(DictionarySourceFactory & factory) .update_lag = config.getUInt64(fmt::format("{}.update_lag", settings_config_prefix), 1) }); - bg_reconnect = config.getBool(fmt::format("{}.bg_reconnect", settings_config_prefix), false); + bg_reconnect = config.getBool(fmt::format("{}.background_reconnect", settings_config_prefix), false); if (config.has(settings_config_prefix + ".replica")) { diff --git a/tests/integration/test_dictionaries_mysql/test.py b/tests/integration/test_dictionaries_mysql/test.py index 0715780abfd..bf391b63d82 100644 --- a/tests/integration/test_dictionaries_mysql/test.py +++ b/tests/integration/test_dictionaries_mysql/test.py @@ -471,7 +471,7 @@ def test_background_dictionary_reconnect(started_cluster): PASSWORD 'clickhouse' DB 'test' QUERY $doc$SELECT * FROM test.dict;$doc$ - BG_RECONNECT 'true' + BACKGROUND_RECONNECT 'true' REPLICA(HOST 'mysql80' PORT 3306 PRIORITY 1))) """ ) diff --git a/tests/integration/test_dictionaries_postgresql/test.py b/tests/integration/test_dictionaries_postgresql/test.py index 5948565eb6f..6ab42cbc3df 100644 --- a/tests/integration/test_dictionaries_postgresql/test.py +++ b/tests/integration/test_dictionaries_postgresql/test.py @@ -623,7 +623,7 @@ def test_background_dictionary_reconnect(started_cluster): PASSWORD 'mysecretpassword' DB 'postgres_database' QUERY $doc$SELECT * FROM dict;$doc$ - BG_RECONNECT 'true' + BACKGROUND_RECONNECT 'true' REPLICA(HOST '{started_cluster.postgres_ip}' PORT {started_cluster.postgres_port} PRIORITY 1))) """ )