Fix ENOENT exception on current_batch.txt in DirectoryMonitor

current_batch.txt will not exist if there was no send, this is the case
when all batches that was pending has been marked as pending.
This commit is contained in:
Azat Khuzhin 2020-05-13 01:21:40 +03:00
parent c811e1f0d0
commit 889f54b549

View File

@ -666,7 +666,10 @@ void StorageDistributedDirectoryMonitor::processFilesWithBatching(const std::map
batch.send();
}
Poco::File{current_batch_file_path}.remove();
/// current_batch.txt will not exist if there was no send
/// (this is the case when all batches that was pending has been marked as pending)
if (Poco::File{current_batch_file_path}.exists())
Poco::File{current_batch_file_path}.remove();
}
bool StorageDistributedDirectoryMonitor::isFileBrokenErrorCode(int code)