Skip to content

Fix incorrect seek in AsynchronousReadBufferFromFileDescriptor with O_DIRECT#99678

Merged
alexey-milovidov merged 6 commits intomasterfrom
fix-seek-async-buf
Mar 18, 2026
Merged

Fix incorrect seek in AsynchronousReadBufferFromFileDescriptor with O_DIRECT#99678
alexey-milovidov merged 6 commits intomasterfrom
fix-seek-async-buf

Conversation

@Avogar
Copy link
Copy Markdown
Member

@Avogar Avogar commented Mar 17, 2026

Changelog category (leave one):

  • Critical Bug Fix (crash, data loss, RBAC)

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

Fix incorrect seek in AsynchronousReadBufferFromFileDescriptor with O_DIRECT. Closes #99358

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

…_DIRECT

getPosition() did not account for bytes_to_ignore, which is set
when O_DIRECT alignment rounds the seek position down. This caused
the NOOP and in-buffer seek checks to produce wrong results, leading
to corrupted reads of Variant subcolumns from wide MergeTree parts
with min_bytes_to_use_direct_io=1.

The same bug was already fixed in AsynchronousBoundedReadBuffer
(remote filesystems), which correctly includes bytes_to_ignore
in its getPosition().
@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Mar 17, 2026

Workflow [PR], commit [9992b46]

Summary:

@clickhouse-gh clickhouse-gh bot added pr-critical-bugfix pr-must-backport Pull request should be backported intentionally. Use this label with great care! labels Mar 17, 2026
@alexey-milovidov alexey-milovidov self-assigned this Mar 17, 2026
Comment thread src/IO/AsynchronousReadBufferFromFileDescriptor.h
@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Mar 18, 2026

LLVM Coverage Report

Metric Baseline Current Δ
Lines 83.80% 83.80% +0.00%
Functions 23.90% 23.90% +0.00%
Branches 76.30% 76.40% +0.10%

PR changed lines: PR changed-lines coverage: 68.00% (17/25, 0 noise lines excluded)
Diff coverage report
Uncovered code

@alexey-milovidov alexey-milovidov added this pull request to the merge queue Mar 18, 2026
Merged via the queue into master with commit 29d4c8d Mar 18, 2026
321 of 322 checks passed
@alexey-milovidov alexey-milovidov deleted the fix-seek-async-buf branch March 18, 2026 16:51
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Mar 18, 2026
robot-clickhouse added a commit that referenced this pull request Mar 18, 2026
robot-clickhouse added a commit that referenced this pull request Mar 18, 2026
robot-clickhouse added a commit that referenced this pull request Mar 18, 2026
robot-clickhouse added a commit that referenced this pull request Mar 18, 2026
robot-clickhouse added a commit that referenced this pull request Mar 18, 2026
@robot-ch-test-poll robot-ch-test-poll added pr-synced-to-cloud The PR is synced to the cloud repo pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore labels Mar 18, 2026
clickhouse-gh bot added a commit that referenced this pull request Mar 18, 2026
Backport #99678 to 26.1: Fix incorrect seek in AsynchronousReadBufferFromFileDescriptor with O_DIRECT
clickhouse-gh bot added a commit that referenced this pull request Mar 18, 2026
Backport #99678 to 26.2: Fix incorrect seek in AsynchronousReadBufferFromFileDescriptor with O_DIRECT
clickhouse-gh bot added a commit that referenced this pull request Mar 18, 2026
Backport #99678 to 25.12: Fix incorrect seek in AsynchronousReadBufferFromFileDescriptor with O_DIRECT
alexey-milovidov added a commit that referenced this pull request Mar 19, 2026
Backport #99678 to 25.8: Fix incorrect seek in AsynchronousReadBufferFromFileDescriptor with O_DIRECT
alexey-milovidov added a commit that referenced this pull request Mar 19, 2026
Backport #99678 to 25.3: Fix incorrect seek in AsynchronousReadBufferFromFileDescriptor with O_DIRECT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-critical-bugfix pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI crash] MergeTreeRangeReader finalize failed during data reading

4 participants