Skip to content

Commit 8550f32

Browse files
committed
fix taskdistributor
1 parent d350e7d commit 8550f32

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/Storages/ObjectStorage/StorageObjectStorageStableTaskDistributor.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ ObjectInfoPtr StorageObjectStorageStableTaskDistributor::getPreQueuedFile(size_t
111111
auto next_file = files.back();
112112
files.pop_back();
113113

114-
auto file_path = send_over_whole_archive ? next_file->getPathOrPathToArchiveIfArchive() : next_file->getPath();
114+
auto file_path = send_over_whole_archive ? next_file->getPathOrPathToArchiveIfArchive() : next_file->getAbsolutePath().value_or(next_file->getPath());
115115
auto it = unprocessed_files.find(file_path);
116116
if (it == unprocessed_files.end())
117117
continue;
@@ -221,7 +221,7 @@ ObjectInfoPtr StorageObjectStorageStableTaskDistributor::getAnyUnprocessedFile(s
221221
auto next_file = it->second.first;
222222
unprocessed_files.erase(it);
223223

224-
auto file_path = send_over_whole_archive ? next_file->getPathOrPathToArchiveIfArchive() : next_file->getPath();
224+
auto file_path = send_over_whole_archive ? next_file->getPathOrPathToArchiveIfArchive() : next_file->getAbsolutePath().value_or(next_file->getPath());
225225
LOG_TRACE(
226226
log,
227227
"Iterator exhausted. Assigning unprocessed file {} to replica {}",
@@ -282,8 +282,8 @@ void StorageObjectStorageStableTaskDistributor::rescheduleTasksFromReplica(size_
282282
replica_to_files_to_be_processed.erase(number_of_current_replica);
283283
for (const auto & file : processed_file_list_ptr->second)
284284
{
285-
auto file_replica_idx = getReplicaForFile(file->getPath());
286-
unprocessed_files.emplace(file->getPath(), std::make_pair(file, file_replica_idx));
285+
auto file_replica_idx = getReplicaForFile(file->getAbsolutePath().value_or(file->getPath()));
286+
unprocessed_files.emplace(file->getAbsolutePath().value_or(file->getPath()), std::make_pair(file, file_replica_idx));
287287
connection_to_files[file_replica_idx].push_back(file);
288288
}
289289
}

src/Storages/ObjectStorage/Utils.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ std::pair<ObjectStoragePtr, std::string> getOrCreateStorageAndKey(
110110

111111
configure_fn(*cfg, config_prefix);
112112

113-
auto & factory = ObjectStorageFactory::instance();
114-
ObjectStoragePtr storage = factory.create(cache_key, *cfg, config_prefix, context, /*skip_access_check*/ true);
113+
ObjectStoragePtr storage = ObjectStorageFactory::instance().create(cache_key, *cfg, config_prefix, context, /*skip_access_check*/ true);
115114

116115
{
117116
std::lock_guard lock(secondary_storages.mutex);

0 commit comments

Comments
 (0)