Merge pull request #67645 from ClickHouse/fix-race-condition-in-settings-processlist

Fix race condition between ProcessList and Settings
This commit is contained in:
Alexey Milovidov 2024-08-03 22:21:49 +00:00 committed by GitHub
commit 4e3202d906
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 4 additions and 6 deletions

View File

@ -61,8 +61,6 @@ private:
void createRootNodes();
void removeAllNodes();
class ReplicatedDatabasesMetadataSync;
/// get_zookeeper will provide a zookeeper client without any fault injection
const zkutil::GetZooKeeper get_zookeeper;
const String root_zookeeper_path;

View File

@ -44,7 +44,7 @@ namespace ErrorCodes
DatabaseLazy::DatabaseLazy(const String & name_, const String & metadata_path_, time_t expiration_time_, ContextPtr context_)
: DatabaseOnDisk(name_, metadata_path_, "data/" + escapeForFileName(name_) + "/", "DatabaseLazy (" + name_ + ")", context_)
: DatabaseOnDisk(name_, metadata_path_, std::filesystem::path("data") / escapeForFileName(name_) / "", "DatabaseLazy (" + name_ + ")", context_)
, expiration_time(expiration_time_)
{
}

View File

@ -12,7 +12,7 @@ class DatabaseLazyIterator;
class Context;
/** Lazy engine of databases.
* Works like DatabaseOrdinary, but stores in memory only cache.
* Works like DatabaseOrdinary, but stores in memory only the cache.
* Can be used only with *Log engines.
*/
class DatabaseLazy final : public DatabaseOnDisk

View File

@ -657,7 +657,7 @@ QueryStatusInfo QueryStatus::getInfo(bool get_thread_list, bool get_profile_even
{
if (auto ctx = context.lock())
{
res.query_settings = std::make_shared<Settings>(ctx->getSettingsRef());
res.query_settings = std::make_shared<Settings>(ctx->getSettingsCopy());
res.current_database = ctx->getCurrentDatabase();
}
}