mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +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);
|
||||||
|
|
||||||
|
bool has_configuration = false;
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(dictionary_config_mutex);
|
||||||
|
|
||||||
if (configuration)
|
if (configuration)
|
||||||
{
|
{
|
||||||
|
has_configuration = true;
|
||||||
configuration->setString("dictionary.database", new_table_id.database_name);
|
configuration->setString("dictionary.database", new_table_id.database_name);
|
||||||
configuration->setString("dictionary.name", new_table_id.table_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