Skip to content

fileservice: write to disk cache in S3FS.Write and Read - #12198

Merged
mergify[bot] merged 1 commit into
matrixorigin:mainfrom
reusee:objectstoragediskcache
Oct 24, 2023
Merged

mergify[bot] merged 1 commit into
matrixorigin:mainfrom
reusee:objectstoragediskcache

Conversation

@reusee

@reusee reusee commented Oct 19, 2023

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:

issue #11569

What this PR does / why we need it:

fileservice: add FileCache

fileservice: rename DiskCache.entryDataFilePath to pathForIOEntry

fileservice: sketch FileCache impl for DiskCache

fileservice: remove S3FS.writeDiskCacheOnWrite

fileservice: add DiskCache.writeFile

fileservice: remove FileCache.GetFile; try get full file in DiskCache.Read

fileservice: add DiskCache.SetFile tests

fileservice: write to disk file cache in S3FS.write

@matrix-meow matrix-meow added the size/M Denotes a PR that changes [100,499] lines label Oct 19, 2023
@reusee
reusee force-pushed the objectstoragediskcache branch from 2df487c to 276ef5d Compare October 19, 2023 09:46

@fengttt fengttt 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.

This change seems to be different from the issue mentioned in pr message.

@reusee
reusee force-pushed the objectstoragediskcache branch 2 times, most recently from ba76004 to 7df3089 Compare October 20, 2023 12:03
@reusee reusee changed the title fileservice: write to disk cache in S3FS.Write fileservice: write to disk cache in S3FS.Write and Read Oct 20, 2023
@reusee

reusee commented Oct 23, 2023

Copy link
Copy Markdown
Contributor Author

This change seems to be different from the issue mentioned in pr message.

The issue number is correct.

@fengttt fengttt 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.

We replace all S3 cache to whole file? Don't we want some kind of config? What about AP cache, we said later it may need to cache all blocks of one column. What about metadata/zonemap, are they in a totally different cache system and not use disk cache at all?

I cannot tell from this change and not sure what we do.

@reusee

reusee commented Oct 24, 2023

Copy link
Copy Markdown
Contributor Author

We replace all S3 cache to whole file? Don't we want some kind of config? What about AP cache, we said later it may need to cache all blocks of one column. What about metadata/zonemap, are they in a totally different cache system and not use disk cache at all?

I cannot tell from this change and not sure what we do.

The file service doesn't know about AP, blocks/column/zonemap. They're handled at the call site.
This change adds file/object cache to the disk cache, not replacing existed IOEntry caches.

fileservice: add FileCache

fileservice: rename DiskCache.entryDataFilePath to pathForIOEntry

fileservice: sketch FileCache impl for DiskCache

fileservice: remove S3FS.writeDiskCacheOnWrite

fileservice: add DiskCache.writeFile

fileservice: remove FileCache.GetFile; try get full file in DiskCache.Read

fileservice: add DiskCache.SetFile tests

fileservice: write to disk file cache in S3FS.write

fileservice: fix testCachingFileService

perfcounter: replace Disk.OpenFile with OpenIOEntryFile, OpenFullFile, CreateFile

fileservice: write to disk file cache in S3FS.read
@reusee
reusee force-pushed the objectstoragediskcache branch from 2208c31 to 54f5af2 Compare October 24, 2023 01:47
@mergify
mergify Bot merged commit 9757df5 into matrixorigin:main Oct 24, 2023
reusee added a commit to reusee/matrixone that referenced this pull request Nov 2, 2023
…#12198)

fileservice: add FileCache

fileservice: rename DiskCache.entryDataFilePath to pathForIOEntry

fileservice: sketch FileCache impl for DiskCache

fileservice: remove S3FS.writeDiskCacheOnWrite

fileservice: add DiskCache.writeFile

fileservice: remove FileCache.GetFile; try get full file in DiskCache.Read

fileservice: add DiskCache.SetFile tests

fileservice: write to disk file cache in S3FS.write

Approved by: @nnsgmsone, @zhangxu19830126
fengttt pushed a commit to fengttt/matrixone that referenced this pull request May 7, 2026
…#12198)

fileservice: add FileCache

fileservice: rename DiskCache.entryDataFilePath to pathForIOEntry

fileservice: sketch FileCache impl for DiskCache

fileservice: remove S3FS.writeDiskCacheOnWrite

fileservice: add DiskCache.writeFile

fileservice: remove FileCache.GetFile; try get full file in DiskCache.Read

fileservice: add DiskCache.SetFile tests

fileservice: write to disk file cache in S3FS.write

Approved by: @nnsgmsone, @zhangxu19830126
XuPeng-SH added a commit that referenced this pull request Sep 16, 2026
## 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]>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…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]>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants