Repository navigation
Implement readBigAt in fs cache read buffer to allow parallelized read (for remote table engines/functions) - #71781
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
|
Dear @kssenii, this PR hasn't been updated for a while. Will you continue working on it? If not, please close it. Otherwise, ignore this message. |
3eae663 to
e2e87ca
Compare
|
Dear @kssenii, this PR hasn't been updated for a while. Will you continue working on it? If not, please close it. Otherwise, ignore this message. |
1 similar comment
|
Dear @kssenii, this PR hasn't been updated for a while. Will you continue working on it? If not, please close it. Otherwise, ignore this message. |
|
Workflow [PR], commit [03c1801] Summary: ❌
|
There was a problem hiding this comment.
Pull request overview
This PR implements the readBigAt method in the filesystem cache read buffer to enable parallelized reads for remote table engines and functions. The implementation allows reading data from arbitrary offsets without affecting the sequential read state.
Key Changes
- Added
readBigAtoverride method supporting parallel reads from arbitrary file offsets - Refactored internal state management by extracting
ReadInfoandReadFromFileSegmentStatestructs - Converted instance methods to static methods where possible to enable state-independent operations
- Added
NONEenum value toReadTypefor uninitialized state tracking
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| src/Disks/IO/CachedOnDiskReadBufferFromFile.h | Declares readBigAt method, introduces ReadInfo struct, and converts member variables to support independent read operations |
| src/Disks/IO/CachedOnDiskReadBufferFromFile.cpp | Implements readBigAt with isolated state, refactors existing methods to use new state structures, and adds static helper methods |
| src/Interpreters/Cache/FileSegment.cpp | Minor formatting change to improve readability of conditional expression |
This reverts commit 6005532.
|
P.S. Failure of |
…-for-cached-read-buffer
…-for-cached-read-buffer
|
Please merge ASAP. |
| context_->getFilesystemReadPrefetchesLog()); | ||
|
|
||
| if (use_prefetch) | ||
| if (use_prefetch && !impl->supportsReadAt()) |
There was a problem hiding this comment.
Why don't we return early like for if (!use_async_buffer) in case impl->supportsReadAt() is true?
What's the point of async buffer if we don't do prefetches here?
There was a problem hiding this comment.
See comment
ClickHouse/src/Storages/ObjectStorage/StorageObjectStorageSource.cpp
Lines 801 to 803 in c736149
Actually
CachedOnDiskReadBufferFromFile does work without async wrapper (it was removed before but moved back under async wrapper as a blind fix for logical error), but I can change this condition in a separate PR.
Co-authored-by: Antonio Andelic <[email protected]>
|
Backport labels have been automatically added based on https://github.com/ClickHouse/clickhouse-core-incidents/issues/1711 Labels added:
These labels ensure backport PRs are properly created for each affected release version. The release automation will create backport PRs as needed based on these labels. |
…ions The s3()/object-storage table-function read path skipped the small-object initial prefetch whenever the read buffer supported readBigAt, because the prefetch was gated on `!impl->supportsReadAt()`. After ClickHouse#71781 added readBigAt to the fs-cache buffer, reads of many tiny files became synchronous and latency-bound (e.g. low-concurrency s3() ingestion of lots of small files). readBigAt/parallel reading only helps large objects; `use_prefetch` already implies the object is small, so restore the prefetch for that case. Adds a stateless regression test.
…ions The s3()/object-storage table-function read path skipped the small-object initial prefetch whenever the read buffer supported readBigAt, because the prefetch was gated on `!impl->supportsReadAt()`. After ClickHouse#71781 added readBigAt to the fs-cache buffer, reads of many tiny files became synchronous and latency-bound (e.g. low-concurrency s3() ingestion of lots of small files). readBigAt/parallel reading only helps large objects; `use_prefetch` already implies the object is small, so restore the prefetch for that case. Adds a stateless regression test.
Linked issues
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Implement readBigAt in fs cache read buffer to allow parallelized read (for remote table engines/functions).
Documentation entry for user-facing changes
CI Settings (Only check the boxes if you know what you are doing):
Version info
26.2.1.844