Skip to content

Commit

Permalink
Merge pull request ClickHouse#60477 from ClickHouse/fix-s3cluster
Browse files Browse the repository at this point in the history
Correctly check keys in s3Cluster
  • Loading branch information
antonio2368 authored Feb 29, 2024
2 parents 54b7f2f + c4ae61f commit 049e46c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Storages/StorageS3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,15 @@ StorageS3Source::KeyWithInfoPtr StorageS3Source::ReadTaskIterator::next(size_t)
if (current_index >= buffer.size())
return std::make_shared<KeyWithInfo>(callback());

return buffer[current_index];
while (current_index < buffer.size())
{
if (const auto & key_info = buffer[current_index]; key_info && !key_info->key.empty())
return buffer[current_index];

current_index = index.fetch_add(1, std::memory_order_relaxed);
}

return nullptr;
}

size_t StorageS3Source::ReadTaskIterator::estimatedKeysCount()
Expand Down

0 comments on commit 049e46c

Please sign in to comment.