mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
replace bg_reconnect with background_reconnect
This commit is contained in:
parent
3aaed348af
commit
5427be71cc
@ -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
|
||||
|
@ -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"))
|
||||
{
|
||||
|
@ -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) \
|
||||
|
@ -119,7 +119,7 @@ void registerDictionarySourceMysql(DictionarySourceFactory & factory)
|
||||
.update_field = named_collection->getOrDefault<String>("update_field", ""),
|
||||
.update_lag = named_collection->getOrDefault<UInt64>("update_lag", 1),
|
||||
.dont_check_update_time = named_collection->getOrDefault<bool>("dont_check_update_time", false),
|
||||
.bg_reconnect = named_collection->getOrDefault<bool>("bg_reconnect", false),
|
||||
.bg_reconnect = named_collection->getOrDefault<bool>("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<mysqlxx::PoolWithFailover>(
|
||||
|
@ -37,7 +37,7 @@ namespace ErrorCodes
|
||||
}
|
||||
|
||||
static const ValidateKeysMultiset<ExternalDatabaseEqualKeysSet> 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<UInt64>("update_lag", 1),
|
||||
});
|
||||
|
||||
bg_reconnect = named_collection->getOrDefault<bool>("bg_reconnect", false);
|
||||
bg_reconnect = named_collection->getOrDefault<bool>("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"))
|
||||
{
|
||||
|
@ -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)))
|
||||
"""
|
||||
)
|
||||
|
@ -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)))
|
||||
"""
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user