Always schedule direct IO to threadpool for pread_threadpool#85765
Merged
azat merged 1 commit intoClickHouse:masterfrom Aug 21, 2025
Merged
Always schedule direct IO to threadpool for pread_threadpool#85765azat merged 1 commit intoClickHouse:masterfrom
azat merged 1 commit intoClickHouse:masterfrom
Conversation
Contributor
|
Workflow [PR], commit [d9c83ad] Summary: ❌
|
Contributor
Author
|
Marked as draft, as the description is not completely correct -- even in cases when there are only |
8419b6f to
f358ed0
Compare
f358ed0 to
779fc19
Compare
azat
reviewed
Aug 21, 2025
azat
reviewed
Aug 21, 2025
azat
reviewed
Aug 21, 2025
azat
reviewed
Aug 21, 2025
5412009 to
ce955d5
Compare
preadv2 with RWF_NOWAIT may perform reads from device and return data (not EAGAIN) when called on fd with O_DIRECT flag. This leads to data reading being executed in query thread, instead of threadpool which is intended for pread_threadpool. This patch skips preadv2 / pagecache checking logic when direct io is requested, so that it always executed in threadpool. Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
ce955d5 to
d9c83ad
Compare
Member
|
CI issues either known or reported |
Member
|
@korowa Thanks for keeping history clean! |
Merged
via the queue into
ClickHouse:master
with commit Aug 21, 2025
582ea77
119 of 122 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #85689
preadv2 with RWF_NOWAIT may perform reads from device and return data (not EAGAIN) when called on fd with O_DIRECT flag. This leads to data reading being executed in query thread, instead of threadpool which is intended for pread_threadpool.
This patch skips preadv2 / pagecache checking logic when direct io is requested, so that it always executed in threadpool.
Simple reproducer out of ClickHouse context
(or added test which demonstrates this behavior)
Changelog category (leave one):
cc @kssenii