Fix lock-order-inversion in DatabaseCatalog

This commit is contained in:
Nikolay Degterinsky 2024-07-03 14:22:33 +02:00 committed by GitHub
parent bf8a82d058
commit 6d3d33638a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -274,10 +274,12 @@ void DatabaseCatalog::shutdownImpl()
database->shutdown();
}
TablesMarkedAsDropped tables_marked_dropped_to_destroy;
{
std::lock_guard lock(tables_marked_dropped_mutex);
tables_marked_dropped.clear();
tables_marked_dropped.swap(tables_marked_dropped_to_destroy);
}
tables_marked_dropped_to_destroy.clear();
std::lock_guard lock(databases_mutex);
for (const auto & db : databases)