Repository navigation
fix: skip full file preload for readutil long scans - #24483
LeftHandCold wants to merge 1 commit into
Conversation
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]>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
There was a problem hiding this comment.
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 preservingSkipMemoryCacheWrites). - 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.
Summary
SkipFullFilePreloadsto readutil long-scan policy afterreadBlockCnt > threshHoldSkipMemoryCacheWritesbehaviorRoot cause
Policy:2only 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 isSkipFullFilePreloads; this PR only adds it on the existing long-scan threshold path.Tests
go test ./pkg/vm/engine/readutil -count=1