Finally fix locking storages for reading during backup.

This commit is contained in:
Vitaly Baranov 2022-07-26 08:58:33 +02:00
parent 4c98a7bc0f
commit 76599d1231

View File

@ -537,12 +537,11 @@ void BackupEntriesCollector::lockTablesForReading()
for (auto & [table_name, table_info] : table_infos)
{
auto storage = table_info.storage;
TableLockHolder table_lock;
if (storage)
{
try
{
table_lock = storage->lockForShare(context->getInitialQueryId(), context->getSettingsRef().lock_acquire_timeout);
table_info.table_lock = storage->lockForShare(context->getInitialQueryId(), context->getSettingsRef().lock_acquire_timeout);
}
catch (Exception & e)
{