Skip to content

fix(fileservice): avoid full-object reads without disk cache - #32137

Merged
mergify[bot] merged 2 commits into
matrixorigin:mainfrom
ck89119:issue-31692-validation-main
Nov 4, 2026
Merged

mergify[bot] merged 2 commits into
matrixorigin:mainfrom
ck89119:issue-31692-validation-main

Conversation

@ck89119

@ck89119 ck89119 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Fixes #31692

What this PR does / why we need it:

Address the remaining uncached-read amplification reported in the validation comment. #32053 fixed bounded MinIO requests, but S3FS still expanded buffered reads to the full object under the default policy even when configuration disabled the disk cache. The downloaded suffix could not be retained for reuse.

  • Select the minimal unfinished-entry range when no disk-cache instance exists, without mutating the caller's policy. Preserve read-to-end behavior and the full-object cache-fill default when disk caching is enabled.
  • Extend existing regression fixtures for zero cache capacities, memory-only caching, disabled cache initialization, and explicit policies. Exercise the real MinIO SDK through NewS3FS with disabled caches and default policy, asserting HTTP Range, response-body bytes, and returned content.
  • The new regression fails before the fix: a three-byte buffered read downloads all 16 fixture bytes. After the fix, it downloads exactly three bytes.

Validation on macOS arm64, Go 1.27.1:

  • Full fileservice and objectio suites passed: 525 and 154 top-level passes respectively; fileservice had seven existing skips.
  • Eleven focused tests passed normally and under -race, including MinIO retry offsets/upper bounds, identity failures, cancellation, and early-close cleanup.
  • Changed executable-block coverage: 100% (4/4 statements). gofmt, package go vet, and golangci-lint 2.14.0 passed.
  • Merged current main; relevant implementation, dependencies, and test inputs remain unchanged, so validation evidence is reused.

Limitations: no live MinIO/S3 service or original 40,000-row SQL scenario was rerun. Credential-dependent/opt-in cases remain skipped; this is not complete QA or production-scale performance acceptance. No SQL BVT was added because SQL result/error semantics are unchanged and the HTTP byte-count oracle directly verifies this storage boundary.

@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 →

@XuPeng-SH

XuPeng-SH commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: d7ed009a274e3147fe192044b05b1f36d33d623b

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

mo-bot review · mo-bot-local · review

Commit: d7ed009a274e3147fe192044b05b1f36d33d623b

Assessment: approve

The fix reuses existing minimal-range selection without adding state or mechanisms. It preserves disk-cache full-object fills, suffix reads and caller policy. No actionable defects remain.

Model: gpt-6.1-sol / max

Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0

Validation:

  • Reviewed the complete delta, discussion, linked issue, affected consumers and reader cleanup paths.

  • Reused frozen current-head successful build, UT, SCA, coverage and multi-CN BVT evidence.

  • Verified relevant inputs remained unchanged through the merge, supporting reuse of the author's reported package and focused normal/race tests.

  • Local source, patch, formatting and discussion-coverage audit passed: checks/1793770701023849476-2.json, source-audit.log and source-audit.json.

Limitations:

  • Local Go tests were not rerun; raw author execution logs were not supplied.

  • Live MinIO/S3, the original 40,000-row SQL scenario and production-scale performance were not validated on this candidate.

@mergify mergify Bot added the queued label Nov 4, 2026
@mergify
mergify Bot merged commit b27f386 into matrixorigin:main Nov 4, 2026
@mergify

mergify Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

✅ Merged into main as b27f386 at 05:40 UTC

Less than a minute in the queue, with no time running CI.

So far

  • ✅ Entered the queue Wed 4 Nov, 05:40 · rule main · triggered by rule Automatic queue on approval for main
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged 05:40 · b27f386 · squash
3 merge conditions met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • github-review-approved · required by GitHub branch protection
  • any of · required by GitHub branch protection:
    • check-success = CI Required
    • check-neutral = CI Required
    • check-skipped = CI Required

Times in UTC · dashboard · how the merge queue works

This branch was previously deployed

1 inactive deployment
ci — d7ed009a Deployed Nov 4, 2026 by ck89119
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: MinIO bounded reads download and drain the entire object suffix

3 participants