mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
StorageDictionary fix potential configuration race
This commit is contained in:
parent
a9ac7fb394
commit
8885748a6c
@ -212,11 +212,20 @@ void StorageDictionary::renameInMemory(const StorageID & new_table_id)
|
|||||||
auto old_table_id = getStorageID();
|
auto old_table_id = getStorageID();
|
||||||
IStorage::renameInMemory(new_table_id);
|
IStorage::renameInMemory(new_table_id);
|
||||||
|
|
||||||
if (configuration)
|
bool has_configuration = false;
|
||||||
{
|
{
|
||||||
configuration->setString("dictionary.database", new_table_id.database_name);
|
std::lock_guard<std::mutex> lock(dictionary_config_mutex);
|
||||||
configuration->setString("dictionary.name", new_table_id.table_name);
|
|
||||||
|
|
||||||
|
if (configuration)
|
||||||
|
{
|
||||||
|
has_configuration = true;
|
||||||
|
configuration->setString("dictionary.database", new_table_id.database_name);
|
||||||
|
configuration->setString("dictionary.name", new_table_id.table_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (has_configuration)
|
||||||
|
{
|
||||||
const auto & external_dictionaries_loader = getContext()->getExternalDictionariesLoader();
|
const auto & external_dictionaries_loader = getContext()->getExternalDictionariesLoader();
|
||||||
auto result = external_dictionaries_loader.getLoadResult(old_table_id.getInternalDictionaryName());
|
auto result = external_dictionaries_loader.getLoadResult(old_table_id.getInternalDictionaryName());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user