Skip to content

[Store] Add opt-in DFS adapter batching for 3FS - #4498

Merged
fcczzz merged 1 commit into
kvcache-ai:mainfrom
2xdevv:feat/dfs-adapter-batch-io
Oct 9, 2026
Merged

fcczzz merged 1 commit into
kvcache-ai:mainfrom
2xdevv:feat/dfs-adapter-batch-io

Conversation

@2xdevv

@2xdevv 2xdevv commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Description

DistributedStorageBackend::BatchWrite and BatchRead dispatch each
descriptor as an individual adapter operation. This PR adds opt-in batch
positional I/O so filesystem adapters can receive multiple requests together.

  • Add FdIoRequest, BatchWriteAt, BatchReadAt, and SupportsBatchIo.
    Default batch implementations execute sequentially and return results
    in request order.
  • Enable the capability for Hf3fsAdapter.
  • Reuse bucket handles within each batch, with at most 64 bucket files
    open per submission.
  • Allow concurrent positional I/O on cached shard descriptors for adapters
    that opt in, while retaining synchronized shard initialization.
  • Preserve per-request errors and existing short-transfer behavior:
    bucket transfers retry; shard transfers report failure.
  • Preserve POSIX per-request bucket handles and serialized shard I/O.

This is the first implementation step of #4497. HF3FS initially uses the
sequential default batch methods; the second PR implements multiple
in-flight requests through USRBIO rings. The benchmark extension is
maintained separately, and the RFC’s performance results cover the
combined series.

Module

  • Mooncake Store (mooncake-store)

Type of Change

  • New feature
  • Refactor
  • Performance improvement

How Has This Been Tested?

Validation for commit 438b7ee1:

  • 122 distinct test cases passed across 11 CTest entries covering DFS
    adapters, allocators, clients, configuration, master behavior, and
    object-storage compatibility.
  • All four native HF3FS integration tests passed against the local 3FS
    cluster mounted at /mnt/3fs, with no skips.
  • Coverage includes multi-object scatter/gather I/O, bucket handle reuse,
    bounded submissions across 65 buckets, concurrent access to the same
    shard, short transfers, and preservation of POSIX routing.
  • The two checksum cases skipped in the general client suite passed in
    the dedicated checksum-enabled target.
  • Scoped pre-commit and changed-line C++ formatting checks passed.

Checklist

  • I have performed a self-review of my own code
  • Changed-line C++ formatting checked with ./scripts/code_format.sh
  • Pre-commit passed on the files changed in this PR
  • Adapter capability and I/O semantics documented in code
  • Tests added for the changed behavior
  • RFC filed: [RFC]: [Store] Batch 3FS adapter I/O through USRBIO rings #4497

AI Assistance Disclosure

  • No AI tools were used
  • AI tools were used (specify below)

OpenAI Codex assisted with implementation, test development and validation,
and drafting this PR description. I reviewed the changes and take
responsibility for them.

Add batch positional I/O entry points to FileSystemAdapter and make
backend batching opt-in through SupportsBatchIo, enabled by Hf3fsAdapter.
The default adapter batch methods retain sequential I/O.

Reuse bucket handles in groups of at most 64 open files and preserve
bucket and shard short-transfer handling. Keep POSIX on per-request
bucket handles and serialized shard I/O.

Cover bucket handle reuse, bounded submissions, short transfers, and
POSIX routing. Prepare 3FS integration fixtures through the shard
allocator and exercise multi-object batches, 65 buckets, and concurrent
shard access. Document the storage layout and execution mode choices
in BatchWrite and BatchRead.

@fcczzz fcczzz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The opt-in batching path preserves per-request error mapping and existing short-transfer semantics while retaining POSIX behavior. Bucket handle reuse is bounded, and shard initialization remains synchronized before concurrent I/O.

@fcczzz
fcczzz merged commit 2ac4086 into kvcache-ai:main Oct 9, 2026
26 checks passed
@2xdevv
2xdevv deleted the feat/dfs-adapter-batch-io branch October 9, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants