Skip to content

Commit 45acc4d

Browse files
committed
Fix lock_object_storage_task_distribution_ms with lost host
1 parent 51862f0 commit 45acc4d

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/Storages/ObjectStorage/StorageObjectStorageStableTaskDistributor.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ std::optional<String> StorageObjectStorageStableTaskDistributor::getMatchingFile
186186
// Queue file for its assigned replica
187187
{
188188
std::lock_guard lock(mutex);
189-
unprocessed_files[file_path] = number_of_current_replica;
189+
unprocessed_files[file_path] = file_replica_idx;
190190
connection_to_files[file_replica_idx].push_back(file_path);
191191
}
192192
}
@@ -277,7 +277,11 @@ void StorageObjectStorageStableTaskDistributor::rescheduleTasksFromReplica(size_
277277

278278
replica_to_files_to_be_processed.erase(number_of_current_replica);
279279
for (const auto & file_path : processed_file_list_ptr->second)
280-
unprocessed_files[file_path] = getReplicaForFile(file_path);
280+
{
281+
auto file_replica_idx = getReplicaForFile(file_path);
282+
unprocessed_files[file_path] = file_replica_idx;
283+
connection_to_files[file_replica_idx].push_back(file_path);
284+
}
281285
}
282286

283287
}

tests/integration/test_s3_cache_locality/test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ def check_s3_gets(cluster, node, expected_result, cluster_first, cluster_second,
8686
"filesystem_cache_name": "'raw_s3_cache'",
8787
}
8888

89-
if lock_object_storage_task_distribution_ms > 0:
90-
settings["lock_object_storage_task_distribution_ms"] = lock_object_storage_task_distribution_ms
89+
settings["lock_object_storage_task_distribution_ms"] = lock_object_storage_task_distribution_ms
9190

9291
query_id_first = str(uuid.uuid4())
9392
result_first = node.query(

0 commit comments

Comments
 (0)