You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: CRC in 2KB data block cause unnecessary memmove (20% CPU time) #25040
The data file contains multiple 2KB CRC-block which require memove to remove the CRC (4 byte) for every 2KB to make a contiguous memory for lz4 decompression. de-interleave operations took 20% CPU time.
Cold-scan profile — where cold time goes (read + decode, NOT materialize)
CPU profile of an f32 table scan (SELECT COUNT(*) … WHERE l2_distance(embedding,'[…]')≥0) with the
SHARED cache reverted to the default ~512 MB (the 3 GB column ≫ cache, so scans stay cold), vs the
warm scan. runtime.memmove (46% of cold CPU) splits cleanly: 46% lz4 decode + 45% FileWithChecksum
de-interleave + 8% UnionBatch.
Cold is read-path + decode bound (~72%); materialize is ~4%. Warm is the mirror — pure
materialize + distance, with zero read/CRC/lz4 (decoded data served from cache).
lz4 runs ONLY on the cold (miss) path — the cache stores decoded data, so a warm hit never
decompresses. The UnionBatch materialization fix is therefore a warm-scan win (~4% of cold vs ~56% of warm).
For bulk cold scans the FileWithChecksum de-interleave is ~21% (vs ~1.85% in point search) — it
scales with bytes pushed through the per-2 KB-CRC on-disk format.
Expected Behavior
reduce/remove the number of memmove for de-interleave
Thanks for the detailed profile. One thing to clarify: this 2KB CRC-block format is specific to the local disk fileservice path (DISK / LocalFS, via FileWithChecksum). It is not inherent to all MatrixOne local tests.
In the standalone/local launch configs, if SHARED is not explicitly configured, mo-service fills it with the default DISK backend. In that case TAE data files are stored through LocalFS, so cold scans can hit FileWithChecksum.ReadAt, read 2KB+CRC blocks, verify CRC, and copy the payload into contiguous memory before lz4 decode. That matches the profile here.
For local testing we can still use the S3FS code path without running MinIO or any external object store. S3FS supports a disk-backed object storage mode: configure SHARED with backend = "S3", set [fileservice.s3].endpoint = "disk", and set [fileservice.s3].bucket to a local directory. In this setup, MatrixOne still uses S3FS semantics, but the objects are stored under a local directory. This avoids the LocalFS / FileWithChecksum 2KB CRC-block layout for the main TAE data path.
LOCAL can still be configured as DISK for local metadata/cache/tmp usage. The table data path is controlled by tn.Txn.Storage.fileservice = "SHARED".
The important part is backend = "S3" plus endpoint = "disk". In the code this creates an S3FS backed by diskObjectStorage; bucket is treated as the local root directory and key-prefix is the object prefix below it.
So I would treat this issue as a LocalFS/DISK backend optimization. It is still worth optimizing if local-disk cold scan performance matters, but for real S3 deployments, and for local tests using S3FS with endpoint = "disk", this specific CRC de-interleave overhead should not be on the main data read path.
Hi, just discuss with Feng. We need to remove the CRC and keep the same file format as s3fs. For compatibility, keep the same LOCAL (with CRC) and create a new LOCAL2 to remove the CRC and change the .toml to use LOCAL2. After a few month and no one complain, we remove LOCAL completely from the repo.
Activity
LeftHandCold commentedon Jun 17, 2026
Thanks for the detailed profile. One thing to clarify: this 2KB CRC-block format is specific to the local disk fileservice path (
DISK/LocalFS, viaFileWithChecksum). It is not inherent to all MatrixOne local tests.In the standalone/local launch configs, if
SHAREDis not explicitly configured,mo-servicefills it with the defaultDISKbackend. In that case TAE data files are stored throughLocalFS, so cold scans can hitFileWithChecksum.ReadAt, read 2KB+CRC blocks, verify CRC, and copy the payload into contiguous memory before lz4 decode. That matches the profile here.For local testing we can still use the
S3FScode path without running MinIO or any external object store.S3FSsupports a disk-backed object storage mode: configureSHAREDwithbackend = "S3", set[fileservice.s3].endpoint = "disk", and set[fileservice.s3].bucketto a local directory. In this setup, MatrixOne still usesS3FSsemantics, but the objects are stored under a local directory. This avoids theLocalFS/FileWithChecksum2KB CRC-block layout for the main TAE data path.LOCALcan still be configured asDISKfor local metadata/cache/tmp usage. The table data path is controlled bytn.Txn.Storage.fileservice = "SHARED".A standalone/local config shape is:
The important part is
backend = "S3"plusendpoint = "disk". In the code this creates anS3FSbacked bydiskObjectStorage;bucketis treated as the local root directory andkey-prefixis the object prefix below it.So I would treat this issue as a LocalFS/DISK backend optimization. It is still worth optimizing if local-disk cold scan performance matters, but for real S3 deployments, and for local tests using S3FS with
endpoint = "disk", this specific CRC de-interleave overhead should not be on the main data read path.cpegeric commentedon Jun 18, 2026
Hi, just discuss with Feng. We need to remove the CRC and keep the same file format as s3fs. For compatibility, keep the same LOCAL (with CRC) and create a new LOCAL2 to remove the CRC and change the .toml to use LOCAL2. After a few month and no one complain, we remove LOCAL completely from the repo.
LeftHandCold commentedon Jun 18, 2026
完全可以不使用localfs,直接配置本地使用s3fs就可以了,不需要再做什么工作去修改localfs
cpegeric commentedon Jun 18, 2026
@LeftHandCold to follow up your idea.
FIX: FileService implements new DISK-V2 backend to replace DISK (#25272)
XuPeng-SH commentedon Jul 17, 2026
@cpegeric please help to close it
FIX: FileService implements new DISK-V2 backend to replace DISK (matr…
FIX: FileService implements new DISK-V2 backend to replace DISK (matr…
FIX: FileService implements new DISK-V2 backend to replace DISK (matr…