mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
fix enable_unfreeze handler and sanitizer hints
This commit is contained in:
parent
f140cedd88
commit
9c371d518f
@ -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:
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<clickhouse>
|
||||
|
||||
<enable_system_unfreeze>true</enable_system_unfreeze>
|
||||
<storage_configuration>
|
||||
<disks>
|
||||
<s31>
|
||||
|
Loading…
Reference in New Issue
Block a user