Repository navigation
Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
Closed issue #27519 involved the same test but a different failure: its second read raced asynchronous cache publication and observed S3/disk-hit counters 2/0. PR #27520 added an explicit FlushCache before that second read. The current failure occurs on the first read's retained-buffer capacity assertion, before that barrier, and has a different root cause.
Branch Name
main
Commit ID
9745d3c913286b7a6472ad47034239926d16613c
Other Environment Information
- Runner: self-hosted Linux/x86 coverage runner
- Workflow: MatrixOne ALL CI, Matrixone UT Coverage / UT Coverage on Ubuntu/x86
- Workflow run 33227712612 attempt 1, failed job 99034584237
- PR head: 69fddf095ce22010a9cedc4d40c6e15c562c5e44
- Go tests use `-short -tags matrixone_test -covermode=set` with repository-wide coverage instrumentation.Actual Behavior
TestS3FSFullObjectDiskCacheFillDoesNotRetainWholeObjectBuffer intermittently fails its first-read capacity assertion:
s3_fs_test.go:1185
Error: "1036231" is not less than "65536"
Immediately before the assertion, the disk-cache worker reports:
write disk cache error: open .../002/fullfoo/<temp>.mofscache.tmp: no such file or directory
The failure is caused by a race between asynchronous disk-cache startup loading and a foreground full-object cache fill:
newDiskCacheWithMetricScope(..., asyncLoad=true, ...)startsloadCachein a goroutine and returns immediately.- The foreground full-object fill calls
MkdirAll(<cache>/fullfoo)and is about to callCreateTemp. loadCacheconcurrently visits<cache>/fullfooand unconditionally callsos.Remove(path)for non-root directories that appear empty.CreateTempthen fails because its parent directory was removed. Disk cache correctly fails open, soreadFullObjectToDiskCacheStreamingfalls back to the regular full-object read.- The regular path returns
content[12345:12352], which retains the full 1 MiB backing buffer. The observed capacity1,036,231is exactly1,048,576 - 12,345, matching this fallback path.
The failing PR changes only catalog, frontend snapshot, and SQL compile code. It does not change pkg/fileservice, disk-cache loading, or S3 reads.
Expected Behavior
Startup cache discovery must not remove directories created or used by the current foreground cache generation. A concurrent first read should either publish the streamed cache file or fail open without returning a small logical range backed by the entire object buffer.
Steps to Reproduce
- Create an
S3FSwith disk-backed object storage and an empty disk-cache directory. Disk cache startup loading is asynchronous. - Immediately write a 1 MiB object with cache writes skipped.
- Read a seven-byte range while allowing startup
loadCacheto run concurrently. - If
loadCacheremoves the newly createdfullfoodirectory betweenMkdirAllandCreateTemp, observe the cache write warning andcap(vec.Entries[0].Data) == 1,036,231.
The existing coverage test exercises this race under repository-wide parallel instrumentation; deterministic coverage should coordinate the loader and foreground create boundary rather than rely on repetition.
Additional information
- Failing job: https://github.com/matrixorigin/matrixone/actions/runs/33227712612/job/99034584237
- Workflow run: https://github.com/matrixorigin/matrixone/actions/runs/33227712612
- Diagnostics artifact: https://github.com/matrixorigin/matrixone/actions/runs/33227712612/artifacts/9707784003
- Historical different failure: [Bug]: TestS3FSFullObjectDiskCacheFillDoesNotRetainWholeObjectBuffer flakes in UT coverage #27519, fixed by test(fileservice): align cache hit assertion with async publication #27520.
- The later
disk cache write recoveredlog confirms the optional cache layer recovered; it does not undo the failed first-read retention contract.
Activity
gouhongshen commentedon Aug 29, 2026
PR #27840 is trying to fix this issue.
gouhongshen commentedon Aug 29, 2026
PR #27840 has merged and is awaiting manual validation. The issue remains open.