Repository navigation
Description
Changes proposed
Purpose and scope
Coordinate Mooncake Store performance work for local SSD and shared DFS, including KVCS, across five tracks: metadata/planning, reads and data reuse, writeback and mixed-load scheduling, backend I/O and transport, and measurement.
This is a roadmap for independently reviewable contributions. Existing PRs retain their own scope and ownership. The main new proposal is a shared cold-read lifecycle for LOCAL_DISK and DFS; the broader roadmap shows how it composes with work already underway instead of introducing duplicate planners, schedulers, or buffer pools.
Statuses below were checked on 2026-11-12. Merged identifies available foundations; Open identifies work still under review, not accepted dependencies; Planned identifies proposed increments without an implementation PR linked here.
1. Metadata and request planning
Reduce control-plane work before increasing data-path concurrency. Reuse existing Query/BatchQuery, operation-owned query results, get sessions, and allocation mechanisms.
| Status | Community work | Optimization |
|---|---|---|
| Open | #5056 | Batch metadata reads by stripe to reduce repeated locking for Exists, Probe, and replica queries. |
| Open | #5106 | Share allocator-directory snapshots, including the promotion-allocation path. |
| Open | #5247 | Batch ranged-read metadata queries and refresh operation-owned leases. |
| Open | #4377 | Native ReadPlan with ordered group readiness and an optional two-group read window. |
Planned: feed the shared cold-read path from these existing planning/session helpers. Reuse selected source descriptors instead of resolving the same key again in every stage. Include planning and queue time in lease handling. Application-group readiness remains a ReadPlan concern; this roadmap does not add another layout parser, session API, or long-lived KVCS metadata cache.
2. Read amplification, data reuse, and MEMORY promotion
Reduce repeated source reads and copies, then reuse verified bytes for subsequent consumers and promotion.
| Status | Community work | Optimization |
|---|---|---|
| Merged | #3929 / #4988 / #5201 | Intra-batch duplicate fanout, file byte-window reads, and direct POSIX DFS reads into host buffers. |
| Merged | #4272 | SSD prefetch-on-exist with shared promotion tasks, throttling, and pressure cooldown. |
| Open | #5108 / #4942 / #4714 | File-window batching, broader direct DFS host destinations, and removal of unused descriptor-DFS restore buffers. |
| Open RFC | #5037 | Shared-DFS to MEMORY promotion, explicit prefetch API, and issued-target lifetime. |
Planned:
- Extend source-aware sharing to overlapping LOCAL_DISK Bucket reads. Share the pinned source for an object common to two batches. Preserve tenant and source-incarnation checks, native batching, and per-key results.
- Promotion from the same payload: deliver verified data to foreground readers immediately and let best-effort promotion consume that data without another source GET. Extend existing Master source/executor checks to DFS in coordination with [RFC]: [Store] Shared-DFS to MEMORY promotion for queued KV prefetch #5037. Reuse promotion allocation, writes, notifications, quotas, leases, and durable metadata handling.
- Shared prefetch execution: extend the accepted [Store] Prefetch SSD-only objects to DRAM on exist #4272 machinery to capable DFS sources. A later Get joins the source read or its ready result without waiting for promotion commit. Prefetch failure does not turn a successful foreground read into a failure.
Preserve eligible direct-to-host and backend-specific zero-copy paths. Shared staging is transient and bounded, not another persistent cache; caller-owned buffers cannot become shared results without sufficient ownership. A partial read cannot publish a complete MEMORY replica.
3. Writeback, eviction, and mixed-load scheduling
Increase useful writeback throughput while protecting foreground latency and ensuring eviction/offload can still make progress.
| Status | Community work | Optimization |
|---|---|---|
| Open | #5020 | Buffered offload write sub-batches with foreground-read backoff. |
| Open | #5305 / #5339 | Parallel bucket offload and multi-disk write bandwidth. These overlap in concurrency scope and require coordination. |
| Open | #5076 | Byte-based offload queue accounting. |
| Open | #2769 | Discard obsolete queued promotion work using a useful-time budget. |
Planned: compose shared reads, prefetch, and promotion with the accepted admission/backpressure mechanisms. Account for queued and in-flight work by operations and retained bytes at the allocation-owning process. Queue wait consumes the existing operation budget; speculation that is no longer useful can be dropped before submission.
Compare the write-concurrency unit and cleanup semantics of #5020/#5305/#5339 before extending them. Do not stack their worker pools or silently inherit different proposed defaults. A later common write-pipeline increment may overlap independent objects/batches while retaining data-write-before-metadata-publication ordering; it remains separate from the initial shared-read work.
Session-retention proposals #4519 and #5088 are related policy discussions. This roadmap does not choose between them or add a competing eviction policy.
4. Backend I/O and data transfer
Keep hardware/adaptor optimization below the shared lifecycle. Useful batching and concurrency depend on the backend, not on one universal executor.
| Status | Community work | Optimization |
|---|---|---|
| Open | #4268 / #2502 | Parallel LOCAL_DISK owner endpoints and useful SSD BatchLoad batching. |
| Open | #5204 | Continuous io_uring issue windows across bucket files. |
| Open | #4510 / #5283 | Native 3FS ring batching and parallel reads for DFS adapters without native batch I/O. |
| Open | #5460 | Concurrent POSIX reads on one cached DFS shard, with exclusive writes and fd repair; complements #5283's batch workers. |
| Open | #5463 | Request-scoped handle reuse for consecutive POSIX DFS bucket reads; retains scalar ordering and avoids repeated open/size-query/close. Coordinate BatchRead dispatch with #5283. |
| Open | #4357 / #5045 | Capability-specific DAX zero-copy and TCP GPU staging/transfer overlap. |
| Open | #5424 | Opt-in POSIX DFS direct I/O and batch synchronization, with backend-specific visibility/durability requirements. |
| Merged | #4727 | Reusable bounded object-storage I/O/staging component; not a complete Master/Client integration. |
Planned: add bounded whole-object read/transfer overlap that both LOCAL_DISK and DFS can use through their existing owners, adapters, and transfer helpers. Reserve capacity before loading the next sub-batch and release it after actual consumers finish. Preserve native batches for KVCS/3FS, avoid equivalent outer worker pools, and retain capability-specific direct paths.
Concurrency work includes multiple caller requests in flight, intra-batch I/O workers, same-shard positional reads, and backend issue depth. Keep each limit with its existing owner and qualify read/write progress under mixed load before increasing concurrency.
Keep three levels separate: ReadPlan schedules application groups; the shared cold-read path overlaps source reads and destination work; the adapter/device controls issue depth. The first common pipeline does not require object fragmentation, a new disk format, a streaming RPC, or a KVCS range API. #4766 is closed prior discussion of whole-object SSD restore overlap, not an active implementation PR.
5. Observability and qualification
Attribute the bottleneck before changing concurrency, and measure foreground reads together with background work.
| Status | Community work | Optimization |
|---|---|---|
| Open | #3643 | Separate metadata-query and data-transfer latency. |
| Open | #4590 | SSD error categories, staging latency, and pinned-pool fallback telemetry. |
| Open | #4864 | Split disk-watermark eviction time into metadata-notification and local work. |
| Open | #4924 | DFS adapter benchmarking in storage_backend_bench, separate from end-to-end Store tests. |
Planned: reuse these metrics and benchmark entry points. Report metadata/planning, admission wait, backend I/O, copy/transfer, promotion, and eviction separately. Track physical read count/bytes and read amplification, useful versus unused speculative bytes, promotion outcomes, and foreground tail latency.
Report shared staging, backend per-thread/ring buffers, transport pinned/registered pools, and promotion targets separately. A shared-buffer limit alone is not a process RSS limit. Evaluate backend-only throughput and end-to-end destination-ready latency; include TTFT only where the application workload is actually exercised.
Shared implementation and correctness rules
These rules apply to new increments across all five tracks:
- Reuse source identity and protection. Coalescing does not share authorization or extend a consumer's lease. Consumers retain their own source/lease/completion checks; coordinate with [Store] Reject expired leases on local disk reads #5197 and [Store] Revalidate lease-expired reads by replica identity #4927. Register a batch's flights and submit its leaders before blocking on joined work, preventing overlapping batches from waiting on unsubmitted leaders.
- Separate data readiness from metadata publication. Preserve the cold replica. Allocate promotion targets as late as practical, revalidate source/task identity, and publish MEMORY from PROCESSING to COMPLETE only after validation and transfer completion. Delete/Upsert must reject stale publication; failure cleans only the attempted promotion after safe drain.
- Release by completion, not elapsed time. A timeout, cancellation, task TTL, or lost reply does not prove that I/O or a remote writer has stopped. Retain staging, source handles, destinations, and promotion allocations until access drains or is fenced. One expired waiter cannot cancel work still useful to another consumer.
- Make backpressure effective. Fallback may bypass optional coalescing, but not hard I/O/memory limits or the caller deadline. Drop inadmissible speculation; measure offload and eviction progress under sustained reads.
- Preserve public behavior. Keep per-key results, checksum rules, synchronous API completion conditions, and existing parameter names/environment variables/defaults. Qualify new behavior as opt-in before considering any default change.
KVCS deletion/OpLog correctness work (#5171/#5157) remains independently reviewable; #5157 currently depends on #5171. Performance changes must preserve the agreed metadata ordering.
HA and reconstruction are different paths. Normal KVCS Master HA recovery uses persisted/replicated metadata and does not require KVCS list; list supports exceptional reconstruction, reconciliation, and orphan cleanup. This does not claim allocator recovery support for every filesystem DFS. Also, PutEnd success can precede OpLog durability: preserve and document that boundary rather than claiming zero metadata loss or using list as proof of a committed write. Current KVCS descriptor recovery and the pre-durability PutEnd test establish these distinct boundaries.
Development tasks
The first four tasks can proceed in parallel. Each item is scoped to an independently reviewable PR. Use the same performance baseline across the read, writeback, and eviction work.
First batch: observability and performance baselines
| Task | First PR | Acceptance |
|---|---|---|
| LOCAL_DISK read I/O and copy metrics | Keep the existing key-based SSD counters. Add backend read submissions and submitted bytes, bytes delivered to callers, shared-read joins, and O_DIRECT bounce-copy counts and bytes. Collect I/O at submission and delivery at the caller boundary. |
Check aligned and unaligned reads, failures, and concurrent identical batches. Show that shared reads reduce backend submissions while both callers still receive data. Report metrics-on/off overhead for small reads. |
| Cold-read staging pressure | Measure time waiting for staging, allocation failures, and current and peak in-use bytes on the allocating process. Align the outer timing with #3643 and coordinate the staging admission boundary with #4795. | Hold staging until a read waits, then release it. The wait should appear in the staging metric and outside the backend I/O timer. Check that bytes remain charged until the last consumer releases them. |
| Master offload queue backlog | Export queued objects, queued bytes, and age of the oldest pending task. Update accounting at queue transitions and align the byte definition with #5076. Pair queue gauges with existing completion rates to see whether writeback is keeping up. | Check enqueue, heartbeat drain, cancellation, repeated completion reports, and client unmount. The queue gauges should return to zero after drain. Collection should require no full queue scan. |
| Cold-tier performance regression workloads | Extend store_kv_bench with aligned and unaligned reads, identical and partially overlapping concurrent batches, and sustained reads alongside writeback and eviction. Start on real NVMe. Add a real KVCS run with one delayed sub-batch to qualify early publication in #5653. Reuse #4924 for adapter-only measurements. |
Publish repeated matched A/B runs with a fixed workload and cache state. Report destination-ready p50/p95/p99, useful throughput, backend read and copy counts, peak staging, and offload and eviction progress. For KVCS, report when followers of completed sources become ready. |
Performance follow-ups
| Task | First PR and acceptance | Coordination |
|---|---|---|
| LOCAL_DISK Bucket reads with partial batch overlap | Start with whole-object reads. Pin the exact bucket source before sharing it. Preserve each caller's source validation and independent buffer lease. For concurrent [A,B] and [B,C], demonstrate four backend object loads becoming three. Exercise same-size replacement, tenant isolation, independent release, and the feature-off path. |
Build on the Bucket prototype and coordinate with its author. |
| Reuse the selected cold source from the read plan | Connect one get_into_ranges path to the shared cold-read executor using the operation-owned source descriptor. Compare Master query counts and cover queue delay past lease expiry, concurrent Upsert, and snapshot reads. |
Align descriptor and lease ownership with #5247 and #4377. |
| Overlap the next SSD read with destination transfer | Start with two windows of whole-object LOCAL_DISK reads. Reserve staging before issuing the next window and release it after actual completion. Measure destination-ready tail latency, useful throughput, and peak staging. Inject cancellation and late completion. |
Reuse existing I/O and transfer helpers. For a later DFS increment, build on the completion boundary in #5653. |
| Use the foreground read payload for promotion | Start with LOCAL_DISK and share the owned, validated bytes. Demonstrate one source read for overlapping Get and promotion, even if promotion fails. Cover source replacement and verify that a partial read cannot publish a complete replica. |
Reuse source identity and buffer ownership from shared reads and the existing Master promotion path. |
| Explicit shared-DFS prefetch into MEMORY | Add the shared-DFS source to existing promotion tasks and quotas. Test capacity pressure, cancellation, source replacement, and late remote writes. An issued target remains reserved until the writer drains or is fenced. | Coordinate the upstream split and target lifetime with #5037. |
| Measure whether prefetch was useful | Start with SSD. Track prefetched bytes served by a later Get, prefetched bytes evicted before use, and work dropped under pressure. Define a bounded tracking window and aggregate without per-key metric labels. | Reuse the existing prefetch lifecycle and validate both consumed and unused results. |
| Reduce idle time between SSD offload heartbeats | Qualify adaptive polling on a workload that refills DRAM after an offload round. Compare sustained writeback throughput, SSD idle time, Master RPC load, and foreground p99 at the same offered load. | Coordinate with the reporter and prototype in #5497. Share the mixed-load baseline with #5020, #5305, and #5339. |
When taking a task, share the proposed scope and backend or transport coverage in this RFC, then link the implementation PR here. Include matched measurements for performance changes and use bounded metric labels on hot paths.
Call for Contributions
Contributions are welcome across all five tracks. Useful starting points include:
- Review and validate existing work. Coordinate with the authors of linked PRs; contribute focused reviews, backend/transport coverage, or reproducible measurements there instead of starting a duplicate implementation.
- Develop a pending increment. The development tasks list gives the scope, acceptance cases, and coordination points for each item.
- Add benchmarks and regression coverage. Isolate metadata, I/O, copy, and queue costs; contribute matched A/B results or focused tests for overlapping reads, resource pressure, cancellation, and late completion.
For a new implementation, post a short scope proposal here with the roadmap track, existing work to reuse, the missing delta, and the intended backend/test coverage. Link the resulting issue or PR back here so the roadmap can distinguish proposed and active work. Small, independently reviewable contributions are welcome; implementing the entire roadmap is not required.
Store-RS implementation precedents
Public source at main 98cce196e2def4ba0dc67324eff6ded671596abe already contains:
- Version/backing-aware client restore singleflight.
- Owner-side read/prefetch sharing and data-ready publication before route CAS.
- Queued asynchronous promotion from the read payload, with version-conditional publication.
These are precedents in supported restore paths, not proof of coverage for every provider/failure case. The owner-side flight map is keyed by ObjectKey, unlike the version-aware client map. Borrow lifecycle/reuse ideas with the exact source checks required here; retain C++ Master metadata and promotion semantics. The cited public snapshot does not establish a general fragment-pipeline implementation.
Acceptance
No new runtime/performance tests were run to prepare this roadmap. Eventual implementation checks should include:
- LOCAL_DISK and DFS single/batch/ranged reads, duplicate and overlapping batches, tenant/version isolation, and compatible whole-value/window consumers.
- Promotion/preload sharing without another source GET, memory pressure, source Delete/Upsert/eviction, independent consumer deadlines, and no regression to successful reads.
- Delayed I/O/transfer completion after cancellation or expiry, teardown, and proof that memory/targets are not recycled while accessed.
- Matched A/B increments, useful-byte throughput, destination-ready p50/p95/p99, peak resource occupancy, and sustained mixed read/write/eviction progress. Small requests and unsupported configurations retain their applicable existing paths.
Before submitting a new issue...
- Related RFCs, open PRs, and source/design documentation were reviewed.
AI assistance disclosure: Codex assisted with source comparison and roadmap drafting. Proposed work is not a claim of implementation or completed performance qualification.
Activity
[-][RFC]: [Store] Shared cold-read lifecycle for LOCAL_DISK and DFS[/-][+][RFC]: [Store] SSD/DFS performance optimization roadmap[/+]github-actions commentedon Nov 12, 2026
Thanks for opening this issue, @zxpdemonio!
16206312A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide
ifeidepig commentedon Nov 13, 2026
I'd like to coordinate a focused follow-up to #2357 under the partial-overlap integration track: source-aware cold-read sharing for LOCAL_DISK's BucketStorageBackend.
I have a local CPU/POSIX prototype based on #2357 at pinned commit c4e28d5. The PR has since advanced to 4df344f; this prototype has not yet been rebased or validated against that updated head. For concurrent [A,B] and [B,C], it shares B only when both requests resolve to the same immutable bucket extent, preserves batching for newly owned keys, and returns independent batch IDs in each caller's original order. In a gated real-file test, backend object loads fall from four to three. This is a backend read-count result, not an SSD throughput or model-latency claim.
The additional scope is:
The prototype is C++ config opt-in and bucket-only. Public BatchGetResult/ReleaseBuffer and RPCs are unchanged. Other backends keep the existing path. Completed-result lingering, already discussed with SnowLegend-star, is excluded, along with DFS, prefetch/promotion and asynchronous cancellation.
Local validation: 43 tests pass on the unmodified #2357 CPU baseline. The prototype adds 13 cases; its focused and adjacent regression run passes 158/158 tests with no failures or skips. Scoped pre-commit checks pass for the five changed files. A separate feature-off control demonstrates the overlap/rebuild assertions. The tests exercise partial/reordered/triangle overlap, tenant separation, same-size source recreation, prepared-read lifetime, independent leases, buffer reclamation, actual file-read failure and a throwing producer. Exact commands, logs and source hashes are retained locally.
Before proposing this for merge, I still need matched SSD measurements, sanitizer runs and measurement of the additional preparation/allocation overhead, including the feature-off BucketStorageBackend::BatchLoad path. The prototype currently reuses prepared reads there as well; default-off does not imply zero overhead. io_uring/RDMA/GPU paths have not been validated.
Would this be an appropriate scope for an independent contribution? Since #2357 is still open, I'd like to agree with its author on either a clearly dependent stacked follow-up or an increment after #2357 lands. If the prepared-read API should be coordinated separately, I can split that foundation from the sharing change.
AI assistance was used for implementation and test development. The human submitter will review and be able to explain the complete diff before any implementation PR.
[Store] Allow concurrent reads on cached DFS shards
[Store] Reuse bucket handles for consecutive DFS reads
DHX98 commentedon Nov 29, 2026
Hi @zxpdemonio, thanks for laying out this roadmap in #5458!
Following up on #4272 and #5598, I'd like to help push two bounded, opt-in / zero-breaking-RPC slices forward under #5458:
Track 1 — Measure whether prefetch was useful (Observability):
route::ObjectState(prefetch_usefulness_window_ms, default 5 min) hookingNotifyPromotionSuccess(from_prefetch), realGetreads (ReadReplicaList/ReadFollowUps, excludingExistKeyand admin reads, counted at most once), eviction (ImmediateReclaimer/OpLogReclaimer), and pressure drops (RegisterPrefetchTask/PromotionAllocStart).MasterMetricManagerandSsdMetric::serialize(), plusOffsetAllocatorStorageBackend::GetObjectDataSize()./metricsscraping (master_prefetch_served_by_get_totalandmaster_prefetch_evicted_before_use_totalverified).Track 2 — Opt-in reuse of foreground cold SSD read payload for promotion:
MOONCAKE_OFFLOAD_REUSE_FOREGROUND_READ_FOR_PROMOTION, defaultfalse) with a bounded byte cap (MOONCAKE_OFFLOAD_PROMOTION_REUSE_MAX_BYTES, default 64 MiB).FileStorage::BatchGetandBatchGetLocal(gated on TE-registeredclient_buffer_allocator_buffers; partialBatchGetRangesnever publish) hand off theirshared_ptr<AllocatedBatch>via an epoch-stamped FIFO cache soPromoteOneKeyFromLocalDisk()skips the duplicate SSD read while holdingshared_ptrownership throughPromotionWritecompletion.BatchOffloadand evict-only invalidation onRunDiskWatermarkEviction(avoiding per-heartbeat false wipes).40 × 2 MiB = 80 MiBcold keys × 3 rounds,promotion_on_hit), this reduced Mooncakessd_read_ops/ssd_read_bytesby 47.5% (up to 50%) in buffered mode and reduced Linux/proc/<pid>/ioNVMe blockread_bytesby 39.42% (up to 49.3%) underio_uring + O_DIRECT, with 100% byte-exact verification and zero foreground p50 regression.Opening separate, small, self-contained PRs for Track 1 and Track 2 shortly so each can be reviewed independently — happy to adjust scope or metric naming per feedback!