mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-02 12:32:04 +00:00
Add mutex for settings
This commit is contained in:
parent
031bfc7bf3
commit
96f62fefcc
@ -1644,7 +1644,7 @@ void MergeTreeData::alterSettings(
|
||||
const Context & context,
|
||||
TableStructureWriteLockHolder & table_lock_holder)
|
||||
{
|
||||
/// No additional locking required, because we took table_lock_holder
|
||||
std::unique_lock lock(settings_mutex);
|
||||
MutableMergeTreeSettingsPtr settings = std::move(*guarded_settings.getPtr()).mutate();
|
||||
settings->updateFromChanges(new_changes);
|
||||
IStorage::alterSettings(new_changes, current_database_name, current_table_name, context, table_lock_holder);
|
||||
|
@ -662,6 +662,7 @@ public:
|
||||
/// get consistent settings.
|
||||
const MergeTreeSettingsPtr getCOWSettings() const
|
||||
{
|
||||
std::shared_lock lock(settings_mutex);
|
||||
return guarded_settings.copyPtr();
|
||||
}
|
||||
|
||||
@ -801,6 +802,8 @@ protected:
|
||||
std::mutex grab_old_parts_mutex;
|
||||
/// The same for clearOldTemporaryDirectories.
|
||||
std::mutex clear_old_temporary_directories_mutex;
|
||||
/// Mutex for settings usage
|
||||
mutable std::shared_mutex settings_mutex;
|
||||
|
||||
void setPrimaryKeyIndicesAndColumns(const ASTPtr & new_order_by_ast, const ASTPtr & new_primary_key_ast,
|
||||
const ColumnsDescription & new_columns,
|
||||
|
Loading…
Reference in New Issue
Block a user