Fix "While sending batch" (on Distributed async send)

This commit is contained in:
Azat Khuzhin 2021-07-16 22:27:30 +03:00
parent 958494b98e
commit 80e614318c

View File

@ -27,6 +27,7 @@
#include <Disks/IDisk.h>
#include <boost/algorithm/string/find_iterator.hpp>
#include <boost/algorithm/string/finder.hpp>
#include <boost/range/adaptor/indexed.hpp>
#include <filesystem>
@ -763,8 +764,8 @@ struct StorageDistributedDirectoryMonitor::Batch
else
{
std::vector<std::string> files(file_index_to_path.size());
for (const auto & [index, name] : file_index_to_path)
files.push_back(name);
for (const auto && file_info : file_index_to_path | boost::adaptors::indexed())
files[file_info.index()] = file_info.value().second;
e.addMessage(fmt::format("While sending batch {}", fmt::join(files, "\n")));
throw;