Skip to content

fix: skip full file preload for readutil long scans - #24483

Closed
LeftHandCold wants to merge 1 commit into
matrixorigin:3.0-devfrom
LeftHandCold:fix/readutil-skip-full-preload-3.0-v2
Closed

LeftHandCold wants to merge 1 commit into
matrixorigin:3.0-devfrom
LeftHandCold:fix/readutil-skip-full-preload-3.0-v2

Conversation

@LeftHandCold

Copy link
Copy Markdown
Collaborator

Summary

  • add SkipFullFilePreloads to readutil long-scan policy after readBlockCnt > threshHold
  • preserve existing SkipMemoryCacheWrites behavior
  • keep the fix scoped to the readutil caller; no fileservice global logic is changed
  • add a regression test for the long-scan policy bits

Root cause

Policy:2 only skipped memory-cache writes. For readutil long scans, the caller could still trigger full-object preloads into disk cache and OS page cache, amplifying range reads into full-file downloads. The missing caller flag is SkipFullFilePreloads; this PR only adds it on the existing long-scan threshold path.

Tests

  • go test ./pkg/vm/engine/readutil -count=1

Long scans already skip memory cache writes after exceeding the read block threshold. Also skip full-file preloads so these range reads do not populate disk cache and OS page cache with whole objects.

Co-authored-by: Copilot <[email protected]>
@LeftHandCold
LeftHandCold requested a review from XuPeng-SH as a code owner May 20, 2026 03:45
Copilot AI review requested due to automatic review settings May 20, 2026 03:45
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the readutil “long scan” read policy so that once the reader passes its long-scan threshold it not only skips memory-cache writes, but also avoids triggering full-file preloads (which can amplify range reads into full-object downloads).

Changes:

  • Refactor per-block read policy selection into reader.nextBlockReadPolicy().
  • Extend the long-scan policy path to include fileservice.SkipFullFilePreloads (while preserving SkipMemoryCacheWrites).
  • Add a regression unit test validating the policy bits after the threshold.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/vm/engine/readutil/reader.go Centralizes and extends long-scan read policy to also skip full-file preloads after the threshold.
pkg/vm/engine/readutil/relation_data_test.go Adds a regression test asserting the long-scan policy includes both skip bits and disables full-file caching behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@matrix-meow matrix-meow added the size/S Denotes a PR that changes [10,99] lines label May 20, 2026
@LeftHandCold

Copy link
Copy Markdown
Collaborator Author

Superseded by the disk cache stale-index root-cause fix. The repeated S3 GETs after SetFile are caused by disk cache index/physical-file inconsistency after async postEvict, not primarily by readutil missing SkipFullFilePreloads. See issue #24493 and replacement PRs #24494 / #24495.

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants