Skip to content

feat(services): reduce list fallback stat for local kv backends#7218

Merged
Xuanwo merged 2 commits intomainfrom
xuanwo/reduce-list-stat-fallback-pr3
Feb 23, 2026
Merged

feat(services): reduce list fallback stat for local kv backends#7218
Xuanwo merged 2 commits intomainfrom
xuanwo/reduce-list-stat-fallback-pr3

Conversation

@Xuanwo
Copy link
Member

@Xuanwo Xuanwo commented Feb 23, 2026

Which issue does this PR close?

Part of #7062.

Rationale for this change

CompleteLayer now guarantees content_length for file entries returned by list, but backends that don't populate size in lister metadata still trigger per-entry fallback stat calls.

For local KV-like backends where size is already available at list time, we can fill content_length directly in service listers and avoid unnecessary fallback stat requests.

What changes are included in this PR?

  • compfs: populate file content_length from DirEntry::metadata().len() in lister.
  • dashmap: lister now reuses cached Metadata instead of reconstructing metadata from key suffix.
  • mini_moka: lister now reuses cached Metadata.
  • moka: lister now reuses cached Metadata.
  • rocksdb: core list now returns (key, value_len) and lister sets file content_length directly.
  • sled: core list now returns (key, value_len) and lister sets file content_length directly.

Are there any user-facing changes?

Yes.

For compfs, dashmap, mini-moka, moka, rocksdb, and sled, file entries returned by list now include content_length directly from lister metadata, which reduces extra fallback stat requests.

AI Usage Statement

This PR was developed with Codex (GPT-5) assistance.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. releases-note/feat The PR implements a new feature or has a title that begins with "feat" labels Feb 23, 2026
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 23, 2026
@Xuanwo Xuanwo merged commit 3c2fedd into main Feb 23, 2026
126 checks passed
@Xuanwo Xuanwo deleted the xuanwo/reduce-list-stat-fallback-pr3 branch February 23, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer releases-note/feat The PR implements a new feature or has a title that begins with "feat" size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants