Repository navigation
fix(fileservice): coalesce same-key warm disk-cache column fills - #28918
Conversation
Coordinate opted-in immutable column fills before disk IO with bounded notification-only generations. Publish through the existing memory-cache path and retain cold-read and admission fallbacks. Add focused lifecycle, cancellation, close, admission and disk-read regression coverage for matrixorigin#28898.
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? |
LeftHandCold
left a comment
There was a problem hiding this comment.
Review of 1de99ef26646175668fda0488aa066bba4c61b36 against fresh main / merge-base 2ea4ec2e6ef4b20321a235ef416228506813e39b: no blocking finding identified; code-review recommendation is APPROVE.
Read all changed hunks in the two production files and test file, and traced the affected S3FS.Read → DiskCache/IOEntry → MemCache publication and ObjectIO marked-entry consumers. This is a focused fix for #28898's reproduced warm-disk amplification, not a general singleflight guarantee or a 4.2 fix.
Key checks:
- Successful disk completion returns through the deferred MemCache update before fill completion wakes followers. Followers reacquire data through the ordinary cache API; notification records do not own decoded buffers.
- An incomplete disk read finishes its fill before remote-cache/S3 fallback. The existing cold IOMerger path is preserved. Failed/cancelled leaders do not publish an error as the fill result.
- Admission preserves the existing one-selected-entry, immutable codec/key and policy restrictions. Disk-index presence and memory headroom are hints, not correctness assumptions; eviction/admission races can reduce coalescing but do not make cache misses incorrect.
- Registry, cache-capacity and disk-index locks are not nested across the new wait or data I/O. Timeout does not rejoin the fill.
Unhappy-path closure:
| Audit | Result |
|---|---|
| Q1 ownership | Read-scoped ticket completion/release is idempotent; decoded buffers retain their existing ownership. Deferred fill release precedes the guarded read's final retirement. |
| Q2 waits | Added follower wait has a one-second timer, context cancellation and service-close wakeup. Close does not wait for the active disk operation under the registry lock. |
| Q3 bounds | 64 live fill generations / 128 participants each; detached generations remain charged until final release. Pointer identity prevents stale-generation deletion. |
Evidence: reused the PR's author-reported final-content FileService normal/race package passes, focused race repetitions, Linux integration and control/benchmark evidence. The source base stated there matches this review's base. These were not re-run by this reviewer; no additional heavy build, UT campaign, or live cluster was started. Local Go 1.26.4 formatting and diff checks passed; isolated worktree is clean. GitHub build/UT checks are still pending/in progress and are not represented as green.
Remaining scope limits are correctly stated: no full IVF-10M SQL latency recovery result, no attribution of all nightly multi-TB reads to this mechanism, and no 4.2 backport. Those are not new blockers for this narrowly tested mechanism fix.
The authenticated account is the PR author, so GitHub prohibits a formal self-APPROVE. This COMMENT records the no-blocker recommendation; it does not change the review state to APPROVED.
XuPeng-SH
left a comment
There was a problem hiding this comment.
GPT-6 medium deep review at exact head 1de99ef.\n\nP2 — required per-test race-stress evidence is missing for the new shared-state concurrency tests, including publication ordering, failure isolation, and close in pkg/fileservice/shared_decode_test.go. The current evidence is a combined-regex race -count=30 report plus a CI package race run; it does not provide individually selected exact-test measurements and adaptive repetitions.\n\nPlease provide exact-head terminal output for each affected test's initial race measurement and separate adaptive repetition run, with test selection and execution mode recorded. This is a validation-evidence blocker, not a demonstrated runtime race.
Follow-up: individual adaptive race validation@XuPeng-SH Thanks. I agree that the previous combined-regex I have now completed the missing validation on unchanged PR head Selection and execution mode
Per-test resultsThe repeat elapsed column is terminal package elapsed for that one exact-test invocation. It is not the initial
Exact commands and terminal outputThe following blocks retain the actual terminal JSON lines. For repetition runs, the last top-level PASS and terminal package PASS are shown; the full raw streams were checked for the exact run/pass counts above. SHA-256 identifies each complete stdout stream. Initial and repetition commands were executed separately, in sequence. TestSharedDecodeFillAdmissionAndKeyIsolationInitial measurement: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=1 -timeout=120s -run '^TestSharedDecodeFillAdmissionAndKeyIsolation$' ./pkg/fileservice{"Time":"2026-09-15T18:50:27.395125+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestSharedDecodeFillAdmissionAndKeyIsolation","Elapsed":0}
{"Time":"2026-09-15T18:50:28.401767+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":1.087}Initial exit: Adaptive repetition: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=100 -timeout=120s -run '^TestSharedDecodeFillAdmissionAndKeyIsolation$' -failfast ./pkg/fileservice{"Time":"2026-09-15T18:50:32.357723+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestSharedDecodeFillAdmissionAndKeyIsolation","Elapsed":0}
{"Time":"2026-09-15T18:50:33.367504+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":1.237}Repeat exit: Complete stdout SHA-256: TestSharedDecodeFillWaitCancellationAndCloseInitial measurement: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=1 -timeout=120s -run '^TestSharedDecodeFillWaitCancellationAndClose$' ./pkg/fileservice{"Time":"2026-09-15T18:50:35.075186+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestSharedDecodeFillWaitCancellationAndClose","Elapsed":0}
{"Time":"2026-09-15T18:50:36.086744+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":1.089}Initial exit: Adaptive repetition: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=100 -timeout=120s -run '^TestSharedDecodeFillWaitCancellationAndClose$' -failfast ./pkg/fileservice{"Time":"2026-09-15T18:50:37.932289+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestSharedDecodeFillWaitCancellationAndClose","Elapsed":0}
{"Time":"2026-09-15T18:50:38.943847+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":1.288}Repeat exit: Complete stdout SHA-256: TestS3FSSharedDecodeDiskFillEligibilityInitial measurement: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=1 -timeout=120s -run '^TestS3FSSharedDecodeDiskFillEligibility$' ./pkg/fileservice{"Time":"2026-09-15T18:50:40.791762+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSharedDecodeDiskFillEligibility","Elapsed":0.02}
{"Time":"2026-09-15T18:50:41.798075+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":1.105}Initial exit: Adaptive repetition: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=100 -timeout=120s -run '^TestS3FSSharedDecodeDiskFillEligibility$' -failfast ./pkg/fileservice{"Time":"2026-09-15T18:50:44.468968+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSharedDecodeDiskFillEligibility","Elapsed":0.01}
{"Time":"2026-09-15T18:50:45.486351+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":2.054}Repeat exit: Complete stdout SHA-256: TestS3FSSharedDecodeDiskFillMemoryEligibilityInitial measurement: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=1 -timeout=120s -run '^TestS3FSSharedDecodeDiskFillMemoryEligibility$' ./pkg/fileservice{"Time":"2026-09-15T18:50:47.292063+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSharedDecodeDiskFillMemoryEligibility","Elapsed":0.05}
{"Time":"2026-09-15T18:50:48.32115+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":1.155}Initial exit: Adaptive repetition: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=100 -timeout=120s -run '^TestS3FSSharedDecodeDiskFillMemoryEligibility$' -failfast ./pkg/fileservice{"Time":"2026-09-15T18:50:55.855362+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSharedDecodeDiskFillMemoryEligibility","Elapsed":0.05}
{"Time":"2026-09-15T18:50:56.914669+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":6.976}Repeat exit: Complete stdout SHA-256: TestS3FSSharedDecodeDiskFillInitial measurement: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=1 -timeout=120s -run '^TestS3FSSharedDecodeDiskFill$' ./pkg/fileservice{"Time":"2026-09-15T18:51:00.108656+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSharedDecodeDiskFill","Elapsed":0.04}
{"Time":"2026-09-15T18:51:01.126346+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":1.134}Initial exit: Adaptive repetition: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=100 -timeout=120s -run '^TestS3FSSharedDecodeDiskFill$' -failfast ./pkg/fileservice{"Time":"2026-09-15T18:51:09.254986+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSharedDecodeDiskFill","Elapsed":0.07}
{"Time":"2026-09-15T18:51:10.310854+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":7.693}Repeat exit: Complete stdout SHA-256: TestS3FSSharedDecodeDiskFillFailureIsolationInitial measurement: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=1 -timeout=120s -run '^TestS3FSSharedDecodeDiskFillFailureIsolation$' ./pkg/fileservice{"Time":"2026-09-15T18:51:13.290165+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSharedDecodeDiskFillFailureIsolation","Elapsed":0.06}
{"Time":"2026-09-15T18:51:14.303398+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":1.144}Initial exit: Adaptive repetition: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=100 -timeout=120s -run '^TestS3FSSharedDecodeDiskFillFailureIsolation$' -failfast ./pkg/fileservice{"Time":"2026-09-15T18:51:25.90588+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSharedDecodeDiskFillFailureIsolation","Elapsed":0.1}
{"Time":"2026-09-15T18:51:26.993692+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":11.196}Repeat exit: Complete stdout SHA-256: TestS3FSSharedDecodeDiskFillCloseInitial measurement: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=1 -timeout=120s -run '^TestS3FSSharedDecodeDiskFillClose$' ./pkg/fileservice{"Time":"2026-09-15T18:51:30.121865+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSharedDecodeDiskFillClose","Elapsed":0.02}
{"Time":"2026-09-15T18:51:31.132599+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":1.113}Initial exit: Adaptive repetition: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=100 -timeout=120s -run '^TestS3FSSharedDecodeDiskFillClose$' -failfast ./pkg/fileservice{"Time":"2026-09-15T18:51:35.583196+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSharedDecodeDiskFillClose","Elapsed":0.04}
{"Time":"2026-09-15T18:51:36.649779+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":3.977}Repeat exit: Complete stdout SHA-256: TestS3FSSharedDecodeDiskFillSkipsColdPathsInitial measurement: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=1 -timeout=120s -run '^TestS3FSSharedDecodeDiskFillSkipsColdPaths$' ./pkg/fileservice{"Time":"2026-09-15T18:51:39.386471+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSharedDecodeDiskFillSkipsColdPaths","Elapsed":0.07}
{"Time":"2026-09-15T18:51:40.397444+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":1.152}Initial exit: Adaptive repetition: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=100 -timeout=120s -run '^TestS3FSSharedDecodeDiskFillSkipsColdPaths$' -failfast ./pkg/fileservice{"Time":"2026-09-15T18:51:51.625647+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSharedDecodeDiskFillSkipsColdPaths","Elapsed":0.09}
{"Time":"2026-09-15T18:51:52.697296+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":10.767}Repeat exit: Complete stdout SHA-256: TestS3FSSharedDecodeDiskHitsInitial measurement: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=1 -timeout=120s -run '^TestS3FSSharedDecodeDiskHits$' ./pkg/fileservice{"Time":"2026-09-15T18:51:55.833001+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSharedDecodeDiskHits","Elapsed":0.02}
{"Time":"2026-09-15T18:51:56.843975+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":1.106}Initial exit: Adaptive repetition: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=100 -timeout=120s -run '^TestS3FSSharedDecodeDiskHits$' -failfast ./pkg/fileservice{"Time":"2026-09-15T18:52:01.437872+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSharedDecodeDiskHits","Elapsed":0.03}
{"Time":"2026-09-15T18:52:02.499635+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":4.165}Repeat exit: Complete stdout SHA-256: TestS3FSSelectedDecodeReadPathsInitial measurement: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=1 -timeout=120s -run '^TestS3FSSelectedDecodeReadPaths$' ./pkg/fileservice{"Time":"2026-09-15T18:52:05.263989+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSelectedDecodeReadPaths","Elapsed":0.05}
{"Time":"2026-09-15T18:52:06.277556+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":1.138}Initial exit: Adaptive repetition: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=100 -timeout=120s -run '^TestS3FSSelectedDecodeReadPaths$' -failfast ./pkg/fileservice{"Time":"2026-09-15T18:52:11.120853+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSelectedDecodeReadPaths","Elapsed":0.03}
{"Time":"2026-09-15T18:52:12.139733+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":4.313}Repeat exit: Complete stdout SHA-256: TestS3FSSelectedDecodeFailureIsolationInitial measurement: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=1 -timeout=120s -run '^TestS3FSSelectedDecodeFailureIsolation$' ./pkg/fileservice{"Time":"2026-09-15T18:52:13.876325+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSelectedDecodeFailureIsolation","Elapsed":0.03}
{"Time":"2026-09-15T18:52:14.890437+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":1.113}Initial exit: Adaptive repetition: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=100 -timeout=120s -run '^TestS3FSSelectedDecodeFailureIsolation$' -failfast ./pkg/fileservice{"Time":"2026-09-15T18:52:17.915026+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSelectedDecodeFailureIsolation","Elapsed":0.01}
{"Time":"2026-09-15T18:52:18.939744+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":2.476}Repeat exit: Complete stdout SHA-256: TestS3FSSelectedDecodeCloseDuringSiblingInitial measurement: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=1 -timeout=120s -run '^TestS3FSSelectedDecodeCloseDuringSibling$' ./pkg/fileservice{"Time":"2026-09-15T18:52:20.654067+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSelectedDecodeCloseDuringSibling","Elapsed":0.02}
{"Time":"2026-09-15T18:52:21.665052+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":1.102}Initial exit: Adaptive repetition: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=100 -timeout=120s -run '^TestS3FSSelectedDecodeCloseDuringSibling$' -failfast ./pkg/fileservice{"Time":"2026-09-15T18:52:24.832752+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSelectedDecodeCloseDuringSibling","Elapsed":0.02}
{"Time":"2026-09-15T18:52:25.87087+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":2.645}Repeat exit: Complete stdout SHA-256: TestS3FSSharedDecodeCloseDefersCacheRetirementInitial measurement: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=1 -timeout=120s -run '^TestS3FSSharedDecodeCloseDefersCacheRetirement$' ./pkg/fileservice{"Time":"2026-09-15T18:52:28.695705+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSharedDecodeCloseDefersCacheRetirement","Elapsed":0.02}
{"Time":"2026-09-15T18:52:29.703788+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":1.098}Initial exit: Adaptive repetition: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=100 -timeout=120s -run '^TestS3FSSharedDecodeCloseDefersCacheRetirement$' -failfast ./pkg/fileservice{"Time":"2026-09-15T18:52:31.942012+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSharedDecodeCloseDefersCacheRetirement","Elapsed":0.01}
{"Time":"2026-09-15T18:52:32.956473+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":1.7610000000000001}Repeat exit: Complete stdout SHA-256: TestS3FSSharedDecodeCloseDuringCacheUpdateInitial measurement: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=1 -timeout=120s -run '^TestS3FSSharedDecodeCloseDuringCacheUpdate$' ./pkg/fileservice{"Time":"2026-09-15T18:52:34.679162+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSharedDecodeCloseDuringCacheUpdate","Elapsed":0.02}
{"Time":"2026-09-15T18:52:35.693337+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":1.103}Initial exit: Adaptive repetition: cd /private/tmp/mo-column-fill-28898-main-20260915
env GOMAXPROCS=4 LC_ALL=C LANG=C GOWORK=off GOFLAGS= TMPDIR=/private/tmp/mo-28918-review5207499186-evidence/tmp .agents/skills/mo-dev/scripts/mo-cgo-test -mod=readonly -race -json -count=100 -timeout=120s -run '^TestS3FSSharedDecodeCloseDuringCacheUpdate$' -failfast ./pkg/fileservice{"Time":"2026-09-15T18:52:38.751052+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Test":"TestS3FSSharedDecodeCloseDuringCacheUpdate","Elapsed":0.02}
{"Time":"2026-09-15T18:52:39.808574+08:00","Action":"pass","Package":"github.com/matrixorigin/matrixone/pkg/fileservice","Elapsed":2.518}Repeat exit: Complete stdout SHA-256: Owning-package evidence and limitsThe previous full Source SHA-256: Full-package log SHA-256: The separate Linux full UT run and multi-CN proxy BVT also passed. They are supplementary evidence, not a substitute for the individual race protocol. This closes the requested validation-evidence gap; it is not a claim of exhaustive race freedom or a proof of zero performance regression in every workload. The head is unchanged. Please re-review the evidence above. |
## What type of PR is this? - [x] Test and CI ## Context The reproduced mechanism from #28898 is already fixed by #28918, and #28888 covers full-object pending-publication rereads. The daily full-object assessment identified a policy boundary that needs to remain explicit. PR #12198 intentionally made the default S3FS read a full-object read and enabled reuse through the disk-cache full-file artifact. A sparse row selection alone is not sufficient evidence to replace that default: legacy vector decoding still follows the whole-column path, and later projected columns can benefit from the same full object. ## What this PR does - Adds a disk-backed S3FS regression guard that verifies `Policy(0)` requests `[0, EOF)` while `SkipFullFilePreloads` remains an explicit bounded-range opt-in. - Adds legacy ObjectIO TopN sparse/dense/explicit-range coverage so legacy TopN does not accidentally inherit the chunked path range policy. - Does not change production code, the default cache policy, prefetch behavior, DiskCache admission/eviction, or SQL semantics. This is a follow-up safety guard, not a claim of an end-to-end Daily/Wiki performance improvement. ## Validation - `GOMAXPROCS=4 .agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/objectio` - `GOMAXPROCS=4 .agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/fileservice` - `GOMAXPROCS=4 .agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -timeout=600s ./pkg/objectio` - `GOMAXPROCS=4 .agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -timeout=600s ./pkg/fileservice` - `go vet -mod=readonly ./pkg/objectio ./pkg/fileservice` with the repository CGo include/link environment - `git diff --check` BVT: N/A. This change only adds internal FileService/ObjectIO regression coverage and does not change SQL behavior. Co-authored-by: XuPeng-SH <[email protected]>
…rixorigin#28918) ## What type of PR is this? - [ ] API-change - [x] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#28898: the reproduced main-branch same-key disk-read/decode amplification mechanism. ## What this PR does / why we need it: ### Problem After concurrent MemCache misses, readers of the same immutable column can each read its DiskCache extent before any reader publishes decoded data. Existing scoped decode sharing starts after disk I/O and has a bounded admission quota. When that quota is exhausted, duplicate decoded allocations can evict useful cache entries before MemCache insertion detects the duplicate key. This causes avoidable read/decode amplification even when the working set fits MemCache. It is distinct from the existing cold-object S3 IOMerger path. ### Narrow change - Coordinate an already `DecodeSharing`-marked immutable column at the `S3FS.Read` boundary, before disk I/O. Keep the existing one-selected-column eligibility and policy checks. - Enter only when DiskCache's existing index reports the full file present, or the exact range for a single-entry request. The index is a hint, not a substitute for the actual read. - Recheck MemCache before I/O. Successful disk-fill leaders notify followers only after deferred MemCache publication; followers then read through the normal cache API. - Do not start a new fill when pending memory reservations or an active memory-pressure target make publication unsuitable. This read-only hint does not reserve or evict anything, and existing same-key fills can still accept followers. - Leave coordination before remote-cache/S3 work when the disk read is incomplete. Cold/unindexed paths do not acquire a fill ticket. ### Lifecycle and bounds - Reuse the existing FileService decoded-read registry and close/read lifetime. The new records hold notification metadata only, not decoded buffers. - Limit live fill generations to 64 and participants per generation to 128. Detached generations remain charged until their final participant releases them. - At most one added fill wait per Read, bounded by one second and interruptible by cancellation or service close. Timeout/admission bypass resumes the existing read path without rejoining the fill. - Completion is a notification, not a shared error result: a failed or canceled leader does not turn a healthy follower into a failed read. - No new goroutines, global disk throttle, cache-budget/eviction changes, SQL/planner changes, routing changes, configuration, production hooks, or persistent-format changes. ### Tests and validation The committed UTs cover same-key disk-fill reuse with available and saturated decode-sharing admission, publication-before-notification, key isolation, participant/generation limits, cancellation, timeout, close, stale-generation release, memory admission, and cold-path bypass. They also retain the existing independent fallback coverage. Validation on the final file contents, based on upstream main `2ea4ec2e6ef4b20321a235ef416228506813e39b`: | Validation | Result | | --- | --- | | Full FileService package, normal | PASS, 15.592s | | Full FileService package, race | PASS, 24.557s | | Focused disk-fill/shared-decode tests, race x30 | PASS, 13.278s | | Linux FileService integration, four CPUs, x5 | PASS | | Same Linux integration, race | PASS | | `go vet ./pkg/fileservice`, formatting, diff checks | PASS | The separate Linux integration uses real FileService, DiskCache, MemCache, native allocation and LZ4 with the local disk-backed object-storage endpoint. Its baseline is `bb358ea76aeb44a6eed5079616e7e75ba35e75b9`; the candidate adds only the two production files. FileService/ObjectIO production code and dependency versions were checked for equivalence between that baseline and the main base above. The external diagnostic harness is not added to this PR. For eight overlapping requests for one missing immutable column, with seven other columns warm and decode sharing saturated: | Counter | Baseline | Candidate | | --- | ---: | ---: | | Disk reads | 8 | 1 | | Conversions | 8 | 1 | | Logical disk bytes | 295,224 | 36,903 | | Retained MemCache data after the wave | 1 MiB | 8 MiB | Payload equality and reservation/registry cleanup are checked. The cold control remains one source GET, zero disk hits and one conversion. Different-key, memory-hit, single-reader and non-admitting controls are also exercised. Adjacent four-core benchmark samples on the final candidate did not reproduce a sustained regression in different-key or memory-ineligible overlapping reads. Samples contain host noise and are not a universal no-regression or speedup claim; the metadata coordination has a small allocation cost. Reproducible owning-package checks, with the repository-supported Go/CGo environment: ```sh GOMAXPROCS=4 .agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s ./pkg/fileservice GOMAXPROCS=4 .agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -timeout=300s ./pkg/fileservice GOMAXPROCS=4 .agents/skills/mo-dev/scripts/mo-cgo-test -race -count=30 -timeout=600s \ -run '^(TestSharedDecodeFill.*|TestS3FSSharedDecodeDiskFill.*|TestS3FSSharedDecodeDiskHits)$' \ ./pkg/fileservice ``` ### Scope and evidence limits This fixes the reproduced mechanism with bounded coordination; it does not guarantee that every same-key miss will coalesce under timeout, cache eviction or admission pressure. Full IVF-10M SQL latency recovery and the fraction of nightly multi-TB traffic attributable to this mechanism have not been validated. No external COS test, cluster rollout or 4.2 backport is claimed. Self-review covered publication ordering, ownership, all ticket terminal paths, cancellation/close, stale generations and resource bounds. No unresolved blocker was found in this scope. Co-authored-by: XuPeng-SH <[email protected]>
…rigin#29017) ## What type of PR is this? - [x] Test and CI ## Context The reproduced mechanism from matrixorigin#28898 is already fixed by matrixorigin#28918, and matrixorigin#28888 covers full-object pending-publication rereads. The daily full-object assessment identified a policy boundary that needs to remain explicit. PR matrixorigin#12198 intentionally made the default S3FS read a full-object read and enabled reuse through the disk-cache full-file artifact. A sparse row selection alone is not sufficient evidence to replace that default: legacy vector decoding still follows the whole-column path, and later projected columns can benefit from the same full object. ## What this PR does - Adds a disk-backed S3FS regression guard that verifies `Policy(0)` requests `[0, EOF)` while `SkipFullFilePreloads` remains an explicit bounded-range opt-in. - Adds legacy ObjectIO TopN sparse/dense/explicit-range coverage so legacy TopN does not accidentally inherit the chunked path range policy. - Does not change production code, the default cache policy, prefetch behavior, DiskCache admission/eviction, or SQL semantics. This is a follow-up safety guard, not a claim of an end-to-end Daily/Wiki performance improvement. ## Validation - `GOMAXPROCS=4 .agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/objectio` - `GOMAXPROCS=4 .agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/fileservice` - `GOMAXPROCS=4 .agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -timeout=600s ./pkg/objectio` - `GOMAXPROCS=4 .agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -timeout=600s ./pkg/fileservice` - `go vet -mod=readonly ./pkg/objectio ./pkg/fileservice` with the repository CGo include/link environment - `git diff --check` BVT: N/A. This change only adds internal FileService/ObjectIO regression coverage and does not change SQL behavior. Co-authored-by: XuPeng-SH <[email protected]>
…rixorigin#28918) ## What type of PR is this? - [ ] API-change - [x] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#28898: the reproduced main-branch same-key disk-read/decode amplification mechanism. ## What this PR does / why we need it: ### Problem After concurrent MemCache misses, readers of the same immutable column can each read its DiskCache extent before any reader publishes decoded data. Existing scoped decode sharing starts after disk I/O and has a bounded admission quota. When that quota is exhausted, duplicate decoded allocations can evict useful cache entries before MemCache insertion detects the duplicate key. This causes avoidable read/decode amplification even when the working set fits MemCache. It is distinct from the existing cold-object S3 IOMerger path. ### Narrow change - Coordinate an already `DecodeSharing`-marked immutable column at the `S3FS.Read` boundary, before disk I/O. Keep the existing one-selected-column eligibility and policy checks. - Enter only when DiskCache's existing index reports the full file present, or the exact range for a single-entry request. The index is a hint, not a substitute for the actual read. - Recheck MemCache before I/O. Successful disk-fill leaders notify followers only after deferred MemCache publication; followers then read through the normal cache API. - Do not start a new fill when pending memory reservations or an active memory-pressure target make publication unsuitable. This read-only hint does not reserve or evict anything, and existing same-key fills can still accept followers. - Leave coordination before remote-cache/S3 work when the disk read is incomplete. Cold/unindexed paths do not acquire a fill ticket. ### Lifecycle and bounds - Reuse the existing FileService decoded-read registry and close/read lifetime. The new records hold notification metadata only, not decoded buffers. - Limit live fill generations to 64 and participants per generation to 128. Detached generations remain charged until their final participant releases them. - At most one added fill wait per Read, bounded by one second and interruptible by cancellation or service close. Timeout/admission bypass resumes the existing read path without rejoining the fill. - Completion is a notification, not a shared error result: a failed or canceled leader does not turn a healthy follower into a failed read. - No new goroutines, global disk throttle, cache-budget/eviction changes, SQL/planner changes, routing changes, configuration, production hooks, or persistent-format changes. ### Tests and validation The committed UTs cover same-key disk-fill reuse with available and saturated decode-sharing admission, publication-before-notification, key isolation, participant/generation limits, cancellation, timeout, close, stale-generation release, memory admission, and cold-path bypass. They also retain the existing independent fallback coverage. Validation on the final file contents, based on upstream main `2ea4ec2e6ef4b20321a235ef416228506813e39b`: | Validation | Result | | --- | --- | | Full FileService package, normal | PASS, 15.592s | | Full FileService package, race | PASS, 24.557s | | Focused disk-fill/shared-decode tests, race x30 | PASS, 13.278s | | Linux FileService integration, four CPUs, x5 | PASS | | Same Linux integration, race | PASS | | `go vet ./pkg/fileservice`, formatting, diff checks | PASS | The separate Linux integration uses real FileService, DiskCache, MemCache, native allocation and LZ4 with the local disk-backed object-storage endpoint. Its baseline is `bb358ea76aeb44a6eed5079616e7e75ba35e75b9`; the candidate adds only the two production files. FileService/ObjectIO production code and dependency versions were checked for equivalence between that baseline and the main base above. The external diagnostic harness is not added to this PR. For eight overlapping requests for one missing immutable column, with seven other columns warm and decode sharing saturated: | Counter | Baseline | Candidate | | --- | ---: | ---: | | Disk reads | 8 | 1 | | Conversions | 8 | 1 | | Logical disk bytes | 295,224 | 36,903 | | Retained MemCache data after the wave | 1 MiB | 8 MiB | Payload equality and reservation/registry cleanup are checked. The cold control remains one source GET, zero disk hits and one conversion. Different-key, memory-hit, single-reader and non-admitting controls are also exercised. Adjacent four-core benchmark samples on the final candidate did not reproduce a sustained regression in different-key or memory-ineligible overlapping reads. Samples contain host noise and are not a universal no-regression or speedup claim; the metadata coordination has a small allocation cost. Reproducible owning-package checks, with the repository-supported Go/CGo environment: ```sh GOMAXPROCS=4 .agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s ./pkg/fileservice GOMAXPROCS=4 .agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -timeout=300s ./pkg/fileservice GOMAXPROCS=4 .agents/skills/mo-dev/scripts/mo-cgo-test -race -count=30 -timeout=600s \ -run '^(TestSharedDecodeFill.*|TestS3FSSharedDecodeDiskFill.*|TestS3FSSharedDecodeDiskHits)$' \ ./pkg/fileservice ``` ### Scope and evidence limits This fixes the reproduced mechanism with bounded coordination; it does not guarantee that every same-key miss will coalesce under timeout, cache eviction or admission pressure. Full IVF-10M SQL latency recovery and the fraction of nightly multi-TB traffic attributable to this mechanism have not been validated. No external COS test, cluster rollout or 4.2 backport is claimed. Self-review covered publication ordering, ownership, all ticket terminal paths, cancellation/close, stale generations and resource bounds. No unresolved blocker was found in this scope. Co-authored-by: XuPeng-SH <[email protected]>
…rigin#29017) ## What type of PR is this? - [x] Test and CI ## Context The reproduced mechanism from matrixorigin#28898 is already fixed by matrixorigin#28918, and matrixorigin#28888 covers full-object pending-publication rereads. The daily full-object assessment identified a policy boundary that needs to remain explicit. PR matrixorigin#12198 intentionally made the default S3FS read a full-object read and enabled reuse through the disk-cache full-file artifact. A sparse row selection alone is not sufficient evidence to replace that default: legacy vector decoding still follows the whole-column path, and later projected columns can benefit from the same full object. ## What this PR does - Adds a disk-backed S3FS regression guard that verifies `Policy(0)` requests `[0, EOF)` while `SkipFullFilePreloads` remains an explicit bounded-range opt-in. - Adds legacy ObjectIO TopN sparse/dense/explicit-range coverage so legacy TopN does not accidentally inherit the chunked path range policy. - Does not change production code, the default cache policy, prefetch behavior, DiskCache admission/eviction, or SQL semantics. This is a follow-up safety guard, not a claim of an end-to-end Daily/Wiki performance improvement. ## Validation - `GOMAXPROCS=4 .agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/objectio` - `GOMAXPROCS=4 .agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/fileservice` - `GOMAXPROCS=4 .agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -timeout=600s ./pkg/objectio` - `GOMAXPROCS=4 .agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -timeout=600s ./pkg/fileservice` - `go vet -mod=readonly ./pkg/objectio ./pkg/fileservice` with the repository CGo include/link environment - `git diff --check` BVT: N/A. This change only adds internal FileService/ObjectIO regression coverage and does not change SQL behavior. Co-authored-by: XuPeng-SH <[email protected]>
) to 4.2-dev (#32361) ## What type of PR is this? - [ ] API-change - [x] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes #32223 Backport of #28918 and the scoped column-decode prerequisite from #28413 to `4.2-dev`. ## What this PR does / why we need it: Concurrent reads of the same immutable array column can all miss MemCache and independently read and decompress a warm DiskCache extent. For eligible scoped Top-N reads, coordinate a bounded warm-disk fill and reuse an immutable decoded result while overlapping consumers hold their read vectors. Followers recheck the existing MemCache and fall back independently on rejection, wait timeout, or failed work; caller cancellation and a close observed by a failed disk conversion stop before another tier. The 4.2 FIFO cache remains responsible for admission and eviction; restore its existing pre-allocation eviction and remove the separate reservation counter. Decode generations have their own bounded lifetime and addressable-backing budget, with unknown or oversized results bypassing sharing. No SQL, wire, catalog, or on-disk format changes are required. ## Validation - Go 1.26.4 and 4.2-built native libraries: full normal and race tests for `pkg/fileservice`, `pkg/fileservice/fifocache`, `pkg/objectio`, `pkg/objectio/ioutil`, `pkg/util/metric/v2`, and the `pkg/vm/engine/tae/blockio` consumer. - CI coverage flags (`-short -tags matrixone_test -covermode=set` and the CI list of 439 instrumented packages) against those owning/consumer packages, including the formerly failing FileService and ObjectIO tests. This is not a full repository CI run. - Twelve exact concurrency/lifecycle/CI regression tests passed adaptive race repetitions (14–100 per test, using a 30-second target and the measured per-test runtime). A persisted S3FS `LoadColumnDataByTopN` test compares shared and unshared results with real cache rejection, different queries, selections, bounds, and cleanup. - Incremental `gofmt -s`, `go vet`, MatrixOne `molint`, and repository-configured `golangci-lint` over the affected closure and complete PR patch. - On 4.2, three 1-second samples of a controlled warm-disk Top-N pair retained two decoded owners without sharing and one with sharing; median latency was 184.9 µs versus 171.0 µs, with 120 versus 134 allocations per pair. This is a small, forced-overlap mechanism test, not evidence of restored 10M-workload QPS. In an admissible eight-reader warm-fill control, disk reads fell from about 4.46 to 1 per batch and median time from 279 to 226 µs. Other FileService controls cover pressure rejection, memory hits, independent keys, and cold object-store reads. A separate unscoped baseline/current control kept allocation counts unchanged (5 per memory hit and 53 per cold read); the larger entry increased measured bytes per operation by about 32 and 65 bytes respectively. The separate CI failure in `TestIssue27966FrontendIVFInternalSQLPreservesQueryPool` occurred during initial four-CN label setup with HAKeeper timeouts, before its SQL workload; a direct causal connection to this change has not been established. The same four-CN test passed locally on this revision in normal mode and under `-race`. --------- Co-authored-by: bRong Njam <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: GreatRiver <[email protected]>
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #28898: the reproduced main-branch same-key disk-read/decode amplification mechanism.
What this PR does / why we need it:
Problem
After concurrent MemCache misses, readers of the same immutable column can each read its DiskCache extent before any reader publishes decoded data. Existing scoped decode sharing starts after disk I/O and has a bounded admission quota. When that quota is exhausted, duplicate decoded allocations can evict useful cache entries before MemCache insertion detects the duplicate key.
This causes avoidable read/decode amplification even when the working set fits MemCache. It is distinct from the existing cold-object S3 IOMerger path.
Narrow change
DecodeSharing-marked immutable column at theS3FS.Readboundary, before disk I/O. Keep the existing one-selected-column eligibility and policy checks.Lifecycle and bounds
Tests and validation
The committed UTs cover same-key disk-fill reuse with available and saturated decode-sharing admission, publication-before-notification, key isolation, participant/generation limits, cancellation, timeout, close, stale-generation release, memory admission, and cold-path bypass. They also retain the existing independent fallback coverage.
Validation on the final file contents, based on upstream main
2ea4ec2e6ef4b20321a235ef416228506813e39b:go vet ./pkg/fileservice, formatting, diff checksThe separate Linux integration uses real FileService, DiskCache, MemCache, native allocation and LZ4 with the local disk-backed object-storage endpoint. Its baseline is
bb358ea76aeb44a6eed5079616e7e75ba35e75b9; the candidate adds only the two production files. FileService/ObjectIO production code and dependency versions were checked for equivalence between that baseline and the main base above. The external diagnostic harness is not added to this PR.For eight overlapping requests for one missing immutable column, with seven other columns warm and decode sharing saturated:
Payload equality and reservation/registry cleanup are checked. The cold control remains one source GET, zero disk hits and one conversion. Different-key, memory-hit, single-reader and non-admitting controls are also exercised.
Adjacent four-core benchmark samples on the final candidate did not reproduce a sustained regression in different-key or memory-ineligible overlapping reads. Samples contain host noise and are not a universal no-regression or speedup claim; the metadata coordination has a small allocation cost.
Reproducible owning-package checks, with the repository-supported Go/CGo environment:
GOMAXPROCS=4 .agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s ./pkg/fileservice GOMAXPROCS=4 .agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -timeout=300s ./pkg/fileservice GOMAXPROCS=4 .agents/skills/mo-dev/scripts/mo-cgo-test -race -count=30 -timeout=600s \ -run '^(TestSharedDecodeFill.*|TestS3FSSharedDecodeDiskFill.*|TestS3FSSharedDecodeDiskHits)$' \ ./pkg/fileserviceScope and evidence limits
This fixes the reproduced mechanism with bounded coordination; it does not guarantee that every same-key miss will coalesce under timeout, cache eviction or admission pressure. Full IVF-10M SQL latency recovery and the fraction of nightly multi-TB traffic attributable to this mechanism have not been validated. No external COS test, cluster rollout or 4.2 backport is claimed.
Self-review covered publication ordering, ownership, all ticket terminal paths, cancellation/close, stale generations and resource bounds. No unresolved blocker was found in this scope.