fix enable_unfreeze handler and sanitizer hints

This commit is contained in:
Vadim Volodin 2022-08-23 13:53:06 +03:00
parent f140cedd88
commit 9c371d518f
5 changed files with 15 additions and 12 deletions

View File

@ -501,7 +501,7 @@ BlockIO InterpreterSystemQuery::execute()
{
getContext()->checkAccess(AccessType::SYSTEM_UNFREEZE);
/// The result contains information about deleted parts as a table. It is for compatibility with ALTER TABLE UNFREEZE query.
result = Unfreezer(getContext()).unfreeze(query.backup_name);
result = Unfreezer(getContext()).systemUnfreeze(query.backup_name);
break;
}
default:

View File

@ -117,21 +117,23 @@ String FreezeMetaData::getFileName(const String & path)
return fs::path(path) / "frozen_metadata.txt";
}
Unfreezer::Unfreezer(ContextPtr context) : local_context(context), zookeeper()
Unfreezer::Unfreezer(ContextPtr context) : local_context(context)
{
if (local_context->hasZooKeeper())
zookeeper = local_context->getZooKeeper();
}
BlockIO Unfreezer::systemUnfreeze(const String & backup_name)
{
LOG_DEBUG(log, "Unfreezing backup {}", escapeForFileName(backup_name));
const auto & config = local_context->getConfigRef();
static constexpr auto config_key = "enable_system_unfreeze";
if (!config.getBool(config_key, false))
{
throw Exception(ErrorCodes::SUPPORT_IS_DISABLED, "Support for SYSTEM UNFREEZE query is disabled. You can enable it via '{}' server setting", config_key);
}
if (local_context->hasZooKeeper())
zookeeper = local_context->getZooKeeper();
}
BlockIO Unfreezer::unfreeze(const String & backup_name)
{
LOG_DEBUG(log, "Unfreezing backup {}", escapeForFileName(backup_name));
auto disks_map = local_context->getDisksMap();
Disks disks;
for (auto & [name, disk]: disks_map)
@ -145,7 +147,7 @@ BlockIO Unfreezer::unfreeze(const String & backup_name)
for (const auto & disk: disks)
{
for (auto store_path: store_paths)
for (const auto& store_path: store_paths)
{
if (!disk->exists(store_path))
continue;

View File

@ -34,7 +34,7 @@ class Unfreezer
public:
Unfreezer(ContextPtr context);
PartitionCommandsResultInfo unfreezePartitionsFromTableDirectory(MergeTreeData::MatcherFn matcher, const String & backup_name, const Disks & disks, const fs::path & table_directory);
BlockIO unfreeze(const String & backup_name);
BlockIO system_unfreeze(const String & backup_name);
private:
ContextPtr local_context;
zkutil::ZooKeeperPtr zookeeper;

View File

@ -16,4 +16,5 @@
<max_concurrent_queries>500</max_concurrent_queries>
<path>./clickhouse/</path>
<users_config>users.xml</users_config>
<enable_system_unfreeze>true</enable_system_unfreeze>
</clickhouse>

View File

@ -1,5 +1,5 @@
<clickhouse>
<enable_system_unfreeze>true</enable_system_unfreeze>
<storage_configuration>
<disks>
<s31>