Files
rustfs/docs/operations/object-data-cache-fill-on-put.md
T
Rain Jiang eca95f2973 perf(ecstore): erasure read path for large GETs (#9304)
Lands the contributor's pull requests #9302 (opt-in lockless KV cache
buckets), #9303 (per-bucket XXH3 ETags; MD5 off the request task) and
#9304 (erasure read path for large GETs) as one change, because #9304
was stacked on the other two.

Maintainer changes on top of the contributed work:
- Merged main. crates/ecstore/src/erasure/coding/bitrot.rs: kept the
  PR's verify_chunked_frame/append_chunked_data restructuring and routed
  its hash-mismatch log through main's throttled log_hash_mismatch.
- rustfs/src/app/multipart_usecase.rs: took main's per-operation split
  and re-applied the PR's changes in place: multipart_etag_algorithm and
  its test in the parent module, the XXH3 pin in create.rs, the stage
  timer and from_stream_with_etag in upload_part.rs.
- Reworded one doc comment in crates/config/src/constants/object.rs that
  spelled an ecstore import path, which the architecture migration guard
  counts as a direct import.
- fix(config): made the MD5 offload opt-in. Each offloaded upload holds
  one blocking-pool thread until its body ends, and that pool also
  serves disk I/O, so many concurrent large uploads could starve disk
  writes. The default threshold is now 0 (disabled); operators enable
  it with RUSTFS_OBJECT_ETAG_MD5_OFFLOAD_MIN_BYTES (for example 8388608).
2026-11-13 10:05:26 +08:00

1.5 KiB

Object data cache: fill on PUT (RUSTFS_OBJECT_DATA_CACHE_FILL_ON_PUT)

The object data cache (RUSTFS_OBJECT_DATA_CACHE_*) fills on GET: the first reader of an object pays the erasure read and the fill, later readers hit. For write-once data that is read right after it is written, such as KV-cache chunks pushed after prefill, the first read is the one that matters.

With RUSTFS_OBJECT_DATA_CACHE_FILL_ON_PUT=true a PUT keeps a copy of its plaintext body while it streams to the erasure encoder and, once the object is committed, inserts it under the same key the GET path plans for that version (after the usual post-put invalidation). The first GET is then a hit.

Only PUTs that meet all of the following are filled:

  • the cache is enabled in a fill mode (fill_buffered_only or fill_materialize_enabled);
  • the body takes the plain streaming path: no compression, no ciphertext passthrough, no SSE request headers (bucket-default encryption is caught by the plan after the commit, and such objects are not inserted);
  • the object size is known and at most the cache's fill ceiling (RUSTFS_OBJECT_DATA_CACHE_MAX_ENTRY_BYTES, clamped like a GET fill).

Cost: one extra in-memory copy of the body for the duration of the PUT (the frames are released after the insert), and the insert itself. Nothing changes for PUTs that do not qualify. Default: off.

Measured with 48 MiB chunks over cuObject RDMA GETs, the first GET after a PUT then comes from memory instead of the drives.