Merge pull request #66017 from ClickHouse/backport/24.6/65986

Backport #65986 to 24.6: Fix race in s3queue
This commit is contained in:
robot-clickhouse-ci-2 2024-07-03 02:55:38 +02:00 committed by GitHub
commit 4e6cf4c75a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -111,10 +111,12 @@ void ObjectStorageQueueSource::FileIterator::returnForRetry(Source::ObjectInfoPt
if (metadata->useBucketsForProcessing())
{
const auto bucket = metadata->getBucketForPath(object_info->relative_path);
std::lock_guard lock(mutex);
listed_keys_cache[bucket].keys.emplace_front(object_info);
}
else
{
std::lock_guard lock(mutex);
objects_to_retry.push_back(object_info);
}
}