Skip to content

Document when to disable check_part_use_direct_io - #134174

Open
groeneai wants to merge 1 commit into
ClickHouse:masterfrom
groeneai:check-part-direct-io-doc
Open

groeneai wants to merge 1 commit into
ClickHouse:masterfrom
groeneai:check-part-direct-io-doc

Conversation

@groeneai

@groeneai groeneai commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #133447
Related: #133431

Changelog category (leave one):

  • Documentation (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

The description of the MergeTree setting check_part_use_direct_io now says to disable it where direct reads are slower than reads through the page cache, for example on Amazon EBS.

Description

The description of check_part_use_direct_io now says when to turn it off. Direct reads always go to the storage device, so checking a table that is already in the page cache becomes bound by device throughput. A nightly benchmark on EBS measured CHECK TABLE of an 85 GiB cached table going from 126-171 s to 582 s and 700 s (about the 125 MiB/s of a default gp3 volume), while on local NVMe the difference was small.

Validation: system.merge_tree_settings shows the new paragraph in the description; the reference page is generated from this string, so nothing under docs/ is edited.


Workflow [PR]
Sync PR [sync-upstream/pr/134174]

Direct reads never use the page cache, so checking a table that is already
cached becomes bound by device throughput. On an EBS gp3 volume (125 MiB/s)
CHECK TABLE of an 85 GiB cached table went from 126-171 s to 582-700 s,
while on local NVMe the difference was small. Say in the setting
description that this is the case where the setting should be turned off.

Related: ClickHouse#133447 (comment)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 0 findings) plus my own review (2 nits).

# Sev Finding Verdict Evidence / action
1 💡 "can be several times slower" leaves the comparison implicit (than with the setting disabled) AGREE, noted implied by the preceding sentence; happy to take a preferred wording
2 💡 the commit subject does not wrap check_part_use_direct_io in inline code AGREE, noted the PR title does; the commit is not amended

Severity: ❌ blocker / ⚠️ major / 💡 nit.

Session id: cron:clickhouse-review-slot-10:20261124-145000

@clickhouse-gh

clickhouse-gh Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [5fcbd04]

Summary: ✅


AI Review

Summary

PR #134174 clarifies when to disable check_part_use_direct_io, explaining the page-cache tradeoff and the potential slowdown on Amazon EBS. Reviewed head 5fcbd0472d44bc965bc38b8f01a02ec28ae6f52b, the full diff, existing discussion, relevant read paths, and the linked benchmark. The documentation agrees with the implementation and benchmark evidence. No actionable findings; this description-only change needs no new regression test.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-documentation Documentation PRs for the specific code PR label Nov 24, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? N/A (setting description only). Oracle: SELECT description FROM system.merge_tree_settings WHERE name = 'check_part_use_direct_io'.
b Root cause explained? check_part_use_direct_io (default true) reads parts with O_DIRECT, which never uses the page cache, so checking a cached table is bound by device throughput (85 GiB at 125 MiB/s is about 700 s). The description did not say this, or that the setting is the way to turn it off.
c Fix matches root cause? Yes: the description is extended at its single source, the DECLARE doc string.
d Test intent preserved / new tests added? No test: the change has no behaviour. Existing tests unchanged.
e Both directions demonstrated? Yes: the built binary shows the new paragraph in system.merge_tree_settings; the master binary does not.
f Fix is general across code paths? Yes: system.merge_tree_settings and the generated reference page both come from this string; nothing under docs/ is edited by hand.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A (no input handling changed).
h Backward compatible? (maintainer-approved exception only) Yes: no setting, default or format change.
i Invariants and contracts preserved? N/A (string literal only).

Session id: cron:clickhouse-impl-slot-40:20261124-143800

@clickhouse-gh clickhouse-gh Bot added can be tested Allows running workflows for external contributors comp-documentation Documentation (docs, examples, READMEs). labels Nov 24, 2026
@clickhouse-gh

clickhouse-gh Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 5fcbd0472 with master 4bb4fd70a (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

7 translation units recompiled, 8 s compile time in total, 7 of them have a recent master baseline.

Job report

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-documentation Documentation (docs, examples, READMEs). pr-documentation Documentation PRs for the specific code PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant