Repository navigation
fix: skip full file preload for readutil long scans - #24484
Closed
LeftHandCold wants to merge 1 commit into
Closed
LeftHandCold wants to merge 1 commit into
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 fixes read amplification for readutil “long scans” by updating the caller-side fileservice.Policy once the reader exceeds its long-scan threshold, ensuring that range reads don’t accidentally trigger full-object preloads into disk cache / OS page cache.
Changes:
- Extend the long-scan threshold path to set
SkipFullFilePreloadsin addition to the existingSkipMemoryCacheWrites. - Refactor policy selection into a small helper (
nextBlockReadPolicy) to keepRead()simpler. - Add a regression unit test validating the policy bits after the threshold is crossed.
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 | Introduces nextBlockReadPolicy() and applies it in persisted-block reads to add SkipFullFilePreloads for long scans. |
| pkg/vm/engine/readutil/relation_data_test.go | Adds a regression test asserting the long-scan policy includes SkipMemoryCacheWrites + SkipFullFilePreloads and does not cache full files. |
Collaborator
Author
1 task done
This branch was previously deployed
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.
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