diff --git a/dbms/src/Storages/MergeTree/DiskSpaceMonitor.cpp b/dbms/src/Storages/MergeTree/DiskSpaceMonitor.cpp index c897d370a49..f16fb83f211 100644 --- a/dbms/src/Storages/MergeTree/DiskSpaceMonitor.cpp +++ b/dbms/src/Storages/MergeTree/DiskSpaceMonitor.cpp @@ -237,7 +237,7 @@ SchemaSelector::SchemaSelector(const Poco::Util::AbstractConfiguration & config, if (!std::all_of(name.begin(), name.end(), isWordCharASCII)) throw Exception("Schema name can contain only alphanumeric and '_' (" + name + ")", ErrorCodes::EXCESSIVE_ELEMENT_IN_CONFIG); schemas.emplace(name, Schema{config, config_prefix + "." + name, disks}); - LOG_INFO(logger, "Storage schema " << name << " Sloaded"); + LOG_INFO(logger, "Storage schema " << name << " loaded"); } constexpr auto default_schema_name = "default"; diff --git a/dbms/src/Storages/MergeTree/DiskSpaceMonitor.h b/dbms/src/Storages/MergeTree/DiskSpaceMonitor.h index 9bae644d4b9..1900b63cf45 100644 --- a/dbms/src/Storages/MergeTree/DiskSpaceMonitor.h +++ b/dbms/src/Storages/MergeTree/DiskSpaceMonitor.h @@ -170,6 +170,8 @@ public: { /// Just make reservation if size is 0 if (size == 0) { + std::lock_guard lock(DiskSpaceMonitor::mutex); + reserves = &DiskSpaceMonitor::reserved[disk_ptr->getName()]; ++reserves->reservation_count; valid = true; return;