mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 21:42:39 +00:00
Add mutex to tryGetTable only for materialized table (not nested)
This commit is contained in:
parent
bd207daa74
commit
3e41c82df1
@ -122,6 +122,8 @@ StoragePtr DatabaseMaterializePostgreSQL::tryGetTable(const String & name, const
|
||||
}
|
||||
}
|
||||
|
||||
/// Note: In select query we call MaterializePostgreSQL table and it calls tryGetTable from its nested.
|
||||
std::lock_guard lock(tables_mutex);
|
||||
auto table = materialized_tables.find(name);
|
||||
/// Here it is possible that nested table is temporarily out of reach, but return storage anyway,
|
||||
/// it will not allow to read if nested is unavailable at the moment
|
||||
|
@ -66,6 +66,7 @@ private:
|
||||
|
||||
std::shared_ptr<PostgreSQLReplicationHandler> replication_handler;
|
||||
std::map<std::string, StoragePtr> materialized_tables;
|
||||
mutable std::mutex tables_mutex;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user