mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Merge pull request #63762 from ClickHouse/backport/24.3/63687
Backport #63687 to 24.3: Cancel S3 reads properly when parallel reads are used
This commit is contained in:
commit
0cf0d81254
@ -191,10 +191,14 @@ size_t ReadBufferFromS3::readBigAt(char * to, size_t n, size_t range_begin, cons
|
|||||||
result = sendRequest(attempt, range_begin, range_begin + n - 1);
|
result = sendRequest(attempt, range_begin, range_begin + n - 1);
|
||||||
std::istream & istr = result->GetBody();
|
std::istream & istr = result->GetBody();
|
||||||
|
|
||||||
copyFromIStreamWithProgressCallback(istr, to, n, progress_callback, &bytes_copied);
|
bool cancelled = false;
|
||||||
|
copyFromIStreamWithProgressCallback(istr, to, n, progress_callback, &bytes_copied, &cancelled);
|
||||||
|
|
||||||
ProfileEvents::increment(ProfileEvents::ReadBufferFromS3Bytes, bytes_copied);
|
ProfileEvents::increment(ProfileEvents::ReadBufferFromS3Bytes, bytes_copied);
|
||||||
|
|
||||||
|
if (cancelled)
|
||||||
|
return initial_n - n + bytes_copied;
|
||||||
|
|
||||||
if (read_settings.remote_throttler)
|
if (read_settings.remote_throttler)
|
||||||
read_settings.remote_throttler->add(bytes_copied, ProfileEvents::RemoteReadThrottlerBytes, ProfileEvents::RemoteReadThrottlerSleepMicroseconds);
|
read_settings.remote_throttler->add(bytes_copied, ProfileEvents::RemoteReadThrottlerBytes, ProfileEvents::RemoteReadThrottlerSleepMicroseconds);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user