mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 17:44:23 +00:00
fix for Replicated database recovery
This commit is contained in:
parent
0989dd837a
commit
b70216f9f1
@ -928,7 +928,16 @@ void DatabaseReplicated::recoverLostReplica(const ZooKeeperPtr & current_zookeep
|
|||||||
for (const auto & table_id : tables_to_create)
|
for (const auto & table_id : tables_to_create)
|
||||||
{
|
{
|
||||||
auto table_name = table_id.getTableName();
|
auto table_name = table_id.getTableName();
|
||||||
auto create_query_string = table_name_to_metadata[table_name];
|
auto metadata_it = table_name_to_metadata.find(table_name);
|
||||||
|
if (metadata_it == table_name_to_metadata.end())
|
||||||
|
{
|
||||||
|
/// getTablesSortedByDependency() may return some not existing tables or tables from other databases
|
||||||
|
LOG_WARNING(log, "Got table name {} when resolving table dependencies, "
|
||||||
|
"but database {} does not have metadata for that table. Ignoring it", table_id.getNameForLogs(), getDatabaseName());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto & create_query_string = metadata_it->second;
|
||||||
if (isTableExist(table_name, getContext()))
|
if (isTableExist(table_name, getContext()))
|
||||||
{
|
{
|
||||||
assert(create_query_string == readMetadataFile(table_name));
|
assert(create_query_string == readMetadataFile(table_name));
|
||||||
|
Loading…
Reference in New Issue
Block a user