Repository navigation
RFC rgw,osd,osdc: S3-over-RDMA served directly from the OSDs (advisory RDMA delivery on MOSDOp) - #71209
RFC rgw,osd,osdc: S3-over-RDMA served directly from the OSDs (advisory RDMA delivery on MOSDOp)#71209mmgaggle wants to merge 55 commits into
Conversation
Integrate NVIDIA cuObject library for out-of-band RDMA data transfer on S3 PUT and GET operations. When enabled, object data bypasses TCP and transfers directly via RDMA between client and server memory, while the S3 control plane (auth, headers, metadata) stays on HTTP. Key components: - RGWCuObjServer singleton managing cuObjServer lifecycle, a pool of pre-registered RDMA buffers, and per-thread channel IDs - PUT path: RDMA_READ from client into registered buffer, then feed through the existing filter chain (checksums, compression, encryption) - GET path: accumulate data into RDMA buffer from the filter chain, then RDMA_WRITE to client at EOF - RDMA bytes included in beast access log and ops log accounting Enabled via cmake flag WITH_RADOSGW_CUOBJ and runtime config rgw_cuobj_enabled, rgw_cuobj_rdma_ip, rgw_cuobj_rdma_port. Signed-off-by: Mark Kogan <[email protected]> Assisted-by: Claude:claude-opus-4-6
The x-amz-rdma-token descriptor is opaque except for its leading
addr:size hex fields. Move the parsing that rgw_cuobj.cc hand-rolled
into common/rdma_token.{h,cc} so the OSD-side cuObject integration can
share it without linking any RGW or cuObject code, bound the accepted
token length, and reject malformed hex instead of throwing from
std::stoull. The token's remaining fields (rkey:lid:qp:has_gid:gid)
stay uninterpreted and are forwarded verbatim.
Signed-off-by: Kyle Bader <[email protected]>
Assisted-by: claude:claude-fable-5
Config Diff Tool Output+ added: rgw_cuobj_osd_push (rgw.yaml.in)
+ added: rgw_cuobj_buffer_size (rgw.yaml.in)
+ added: rgw_cuobj_rdma_port (rgw.yaml.in)
+ added: rgw_cuobj_put_passthrough (rgw.yaml.in)
+ added: rgw_cuobj_buffer_count (rgw.yaml.in)
+ added: rgw_cuobj_num_dcis (rgw.yaml.in)
+ added: rgw_cuobj_fence_drain_ms (rgw.yaml.in)
+ added: rgw_cuobj_crc64nvme (rgw.yaml.in)
+ added: rgw_cuobj_rdma_ip (rgw.yaml.in)
+ added: rgw_cuobj_enabled (rgw.yaml.in)
+ added: rgw_cuobj_client_config (rgw.yaml.in)
+ added: rgw_cuobj_osd_passthrough (rgw.yaml.in)
+ added: rdma_network_interface (global.yaml.in)
+ added: rdma_network (global.yaml.in)
+ added: osd_cuobj_gather_config (osd.yaml.in)
+ added: osd_cuobj_gather_slots (osd.yaml.in)
+ added: osd_cuobj_rdma_port (osd.yaml.in)
+ added: osd_cuobj_gather_quarantine (osd.yaml.in)
+ added: osd_cuobj_buffer_count (osd.yaml.in)
+ added: osd_cuobj_fanout_delivery (osd.yaml.in)
+ added: osd_cuobj_gather_slot_size (osd.yaml.in)
+ added: osd_cuobj_pull_writes_direct (osd.yaml.in)
+ added: osd_cuobj_dc_key (osd.yaml.in)
+ added: osd_cuobj_rdma_ip (osd.yaml.in)
+ added: osd_cuobj_pull_writes (osd.yaml.in)
+ added: osd_cuobj_num_dcis (osd.yaml.in)
+ added: osd_cuobj_register_in_place (osd.yaml.in)
+ added: osd_cuobj_enabled (osd.yaml.in)
+ added: osd_cuobj_gather_enabled (osd.yaml.in)
+ added: osd_cuobj_buffer_size (osd.yaml.in)
! changed: bluestore_csum_type: old: ['none', 'crc32c', 'crc32c_16', 'crc32c_8', 'xxhash32', 'xxhash64'] (global.yaml.in)
! changed: bluestore_csum_type: new: ['none', 'crc32c', 'crc32c_16', 'crc32c_8', 'xxhash32', 'xxhash64', 'crc64nvme'] (global.yaml.in)
! changed: bluestore_csum_type: old: Algorithms crc32c, xxhash32, and xxhash64 are available. The _16 and _8 variants use only a subset of the bits for more compact (but less reliable) checksumming. (global.yaml.in)
! changed: bluestore_csum_type: new: Algorithms crc32c, xxhash32, xxhash64, and crc64nvme are available. The _16 and _8 variants use only a subset of the bits for more compact (but less reliable) checksumming. crc64nvme stores the canonical CRC-64/NVME value of each block (8 bytes), the checksum family used by S3 full-object checksums and NVMe protection information; adjacent block values can be combined without rereading data. (global.yaml.in)
The above configuration changes are found in the PR. Please update the relevant release documentation if necessary. |
|
@bill-scales I know you took a look at the first pass of this PR, but I've updated it based on your comments. I also created #71295, which lays the groundwork for using bluestore checksums to calculate the |
|
You are on fire Kyle! :) Not sure how to review this one though. We probably need to have some high level architectural discussion here or on the mailing list. Do you have any performance tests yet? |
|
jenkins test make check arm64 |
|
Pushed three commits following the lease discussion with @bill-scales:
Validation: wire-format unit test, guarded OSD code compiled with |
Hardware validation on ConnectX-6 DxBuilt and tested this series (at A 3-OSD vstart cluster and the gateway ran on one host; the cuObject client ran on Built with Results
End-to-end GETs, md5 of the client's registered window compared against the source
That covers the multi-initiator question raised in the description: several OSDs Degradation paths:
Two fixes
When stripes come back inline and the GET restarts in a fallback mode, Reproduce with a delivery lease short enough that the OSDs decline the push. The Before: HTTP 500, 239-byte error body. After: HTTP 200,
Not covered
|
EC validationFollow-on to the hardware testing above, covering erasure coding. Same rig: 3-OSD Base geometry: EC profile
Per-OSD Linear placement, EC primary reads (cases 1 and 2)Plain EC pools work through the passthrough path with no client changes, as the Chunk-interleaved placement, EC split reads (cases 3 and 4)Reaching the shard-direct path from RGW needs two things, neither on by default:
The pool flag is only permission -- the client still decides per op -- so both are Case 4 is the one that actually exercises the interleave. At Case 3 is worth recording as a trap: at Suggested doc addition
Not covered
|
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
Pushed six commits (5543b2f..94853da) that firm up the out-of-band delivery Interface and semanticsThese are mostly docs plus small, behavior-preserving code changes, made now
Per-range CRC for scattered deliveryA shard OSD serving a shard-direct EC read pushes every other chunk of the The blob is non-combinable; the individual chunks are not. Every placement The single
Build fix (unrelated, could be split out)
TestingBuilt with Unit:
Hardware (3-OSD vstart on one host over loopback, cuObject client on a second,
|
94853da to
6f56bc4
Compare
Add a read-class op that asks the OSD to deliver an extent out of band: instead of returning data inline, the OSD RDMA-writes it into the client memory window identified by an opaque descriptor token (the S3 x-amz-rdma-token forwarded by RGW) at the token's base address plus a caller-supplied offset. The reply carries only a byte count, so per-stripe replies stay tiny and reply ordering stops mattering to the caller. The extent rides in op.extent as usual; a versioned payload (token, client offset, reserved flags) rides in indata. OSDs that predate the op, are built without cuObject support, or have it disabled all fail the op with -EOPNOTSUPP, which callers use to fall back to ordinary reads - the new librados test pins that contract, and a unit test pins the exact payload byte layout (it is hand-encoded, so the encoding corpus cannot catch drift, and CI has no RDMA hardware to catch it at runtime). The librados surface follows the omap_rm_range precedent: C++ method only, no C API, no version bump (the linker map wildcard exports it). Signed-off-by: Kyle Bader <[email protected]> Assisted-by: claude:claude-fable-5 Signed-off-by: Kyle Bader <[email protected]>
Give each OSD an optional cuObject DC endpoint (WITH_OSD_CUOBJ + osd_cuobj_enabled) mirroring the RGW-side integration: one cuObjServer bound to the OSD's RDMA NIC, a pool of pre-registered host staging buffers with a capped one-shot registration overflow path (transient registrations pin client-controlled amounts of memory, so they are bounded at 4x the pool buffer size), and lazily allocated per-op-thread channels (DCIs). CEPH_OSD_OP_READ_RDMA reads the extent through the same do_read() path as CEPH_OSD_OP_READ (identical clamping, digest verification and read accounting), then hands the data to cuObjServer::handleGetObject, which RDMA-writes it into the client window named by the forwarded descriptor token at token base + client offset; the reply carries only the byte count, and the pushed bytes are accounted toward the OSD's client-read throughput counters. The target range is validated against the token's window here and again inside the library. Because the RDMA write is a side effect the resend machinery knows nothing about, the op refuses retransmitted requests (retry_attempt > 0) with -EOPNOTSUPP: a resent op after a peering change could double-execute against client memory while the superseded attempt's write is still in flight on another OSD, so the caller falls back to a single-writer path instead. Nonzero reserved payload flags are refused the same way so future clients get a clean fallback rather than silent misbehavior. The RDMA write is synchronous on the op worker thread for now - the same shape as the RGW integration's beast-thread calls - bounded by the transport's timeout/retry budget; a dead client NIC can stall a shard for a couple of seconds worst case. Moving it behind -EINPROGRESS + OpFinisher with a dedicated completion Finisher is the planned follow-up, as is EC pool support (erasure pools currently return -EOPNOTSUPP, as do OSDs with the feature absent or disabled, and clusters whose require_osd_release predates this op). The dc_key must match the cuObject client library cluster-wide (default 0xffeeddcc); osd_cuobj_rdma_ip defaults to the OSD's public address and must be overridden when the RDMA NIC is a different interface. WITH_OSD_CUOBJ finds ibverbs itself so it does not depend on WITH_RDMA being enabled. Signed-off-by: Kyle Bader <[email protected]> Assisted-by: claude:claude-fable-5 Signed-off-by: Kyle Bader <[email protected]>
When rgw_cuobj_osd_passthrough is enabled and a GET carries x-amz-rdma-token, forward the token to the OSDs instead of staging the object in RGW memory: the manifest walk issues CEPH_OSD_OP_READ_RDMA per stripe, each OSD RDMA-writes its stripe into client memory at the stripe's logical offset within the requested range, and RGW aggregates the returned byte counts before answering with x-amz-rdma-reply: 200. Object data never touches the radosgw, so a passthrough deployment needs no cuObject library or RDMA NIC on the gateway - only on the OSDs. The existing aio window (rgw_get_obj_window_size) now throttles OSD-side RDMA pressure on the client NIC. A request is eligible only when no data transform is engaged (no compression, encryption, lua or flight filter), the object is not a Swift DLO/SLO, d3n caching is off, and the whole response fits the client's registered window; head-object prefetch is disabled when a token is present so inline head data cannot sneak back into the RGW-side path. Everything else - and any stripe answered with -EOPNOTSUPP by an OSD that lacks the op (old OSDs, EC pools, cuObject absent or disabled) - restarts the whole GET in the staged mode from the base cuObject integration, or plain HTTP with x-amz-rdma-reply: 501 (the protocol's documented fallback signal, now also sent whenever a token arrives and RDMA is unavailable). The restart is safe because passthrough never commits HTTP bytes and rewriting partially written client ranges is idempotent; outstanding stripe ops are always drained before any reply. Two guards make the passthrough contract enforceable against SAL stores and filters that predate params.rdma_token: the filter driver forwards the token at iterate() time (it is set after prepare()), and get_data_cb() rejects unexpected inline data with -EOPNOTSUPP before any HTTP bytes are committed, which routes such configurations into the same transparent fallback. The staged mode inherited from the base integration now reserves its staging buffer at mode-selection time - after the response headers are out there is no way left to signal a staging failure, and the previous first-chunk acquisition could silently drop the whole body while still reporting success; acquisition failure now downgrades to plain HTTP before headers commit, and overflow aborts the response. Multipart objects and range GETs work unchanged (same manifest walk; client offset = stripe logical offset - range start). RDMA bytes are accounted in the usage log and the ops log toward the direction the object data actually moved. Signed-off-by: Kyle Bader <[email protected]> Assisted-by: claude:claude-fable-5 Signed-off-by: Kyle Bader <[email protected]>
check_nasm_support() assembles three probe sources with -o /dev/null to learn which instruction sets the installed nasm handles. nasm deletes its output file when assembly fails, and a failing probe is the point of a probe: on a nasm without VPCLMUL support the third one fails, nasm calls remove() on its output, and when the configure step runs as root that unlinks the device node. The next process to redirect to /dev/null then creates a regular file there, and sshd stops accepting connections until someone recreates the node from a console. Point the probes at a scratch file under CMakeFiles instead. Assisted-by: Claude:claude-opus-5 Signed-off-by: Kyle Bader <[email protected]>
The vendored isa-l already carries CRC-64/NVME ("rocksoft") kernels for
x86 (PCLMULQDQ/AVX2/AVX512) and aarch64 (PMULL, incl. SVE) behind a
runtime-dispatch multibinary, and ceph already builds all of isa-l as
the ISAL::ISAL target for the EC plugin. Route ceph::crc64nvme through
crc64_rocksoft_refl whenever WITH_EC_ISA_PLUGIN is on: same convention
as the madler tables (seed 0 canonical, inversion internal), so it is a
drop-in backend. The madler tables remain the portable fallback and
still provide the combine math, which isa-l does not implement.
On one Zen 5 core (Ryzen AI MAX+ 395) this takes a 4 MiB-buffer
checksum loop from 2.45 GB/s (tables) to 78 GB/s, which matters once
every BlueStore write can be checksumming 4K blocks with it.
A new unit test pins the isa-l backend against the portable tables
across lengths, alignments and chaining seeds (and degrades to a
tables-vs-tables identity when isa-l is not built).
Signed-off-by: Kyle Bader <[email protected]>
Assisted-by: claude:claude-fable-5
Signed-off-by: Kyle Bader <[email protected]>
New CSumType CSUM_CRC64NVME (=7, appended before CSUM_MAX so existing on-disk values are untouched) with the usual Alg struct and cases in the four helper switches. Values are 8 bytes per csum block, like xxhash64. The one framework change: calculate()'s default-init overload and verify() hardcoded an init value of -1, which every existing algorithm wants but crc64nvme must not use - its canonical convention seeds with 0 so that each stored block value equals the standard CRC-64/NVME of that block. Each Alg now declares its default_init (unchanged -1 for the existing five) and the framework uses it. Keeping the stored values canonical is the point of the type: they combine linearly across blocks and match the checksum family used end to end by S3 x-amz-checksum-crc64nvme, the RDMA passthrough path and NVMe's 64-bit protection-information guard tags. Unit tests cover the helper mappings, canonical per-block values, the block-to-whole combine property, and bad-block pinpointing in verify. Signed-off-by: Kyle Bader <[email protected]> Assisted-by: claude:claude-fable-5 Signed-off-by: Kyle Bader <[email protected]>
Wire CSUM_CRC64NVME through blob checksum calculation and verification, the bluestore_csum_type enum values, and the pool csum_type path (which validates through Checksummer's string mapping and needed no change). Costs 8 bytes per csum block like xxhash64. The draw is not the wider checksum so much as what the value is: each block's stored checksum is the canonical CRC-64/NVME of that block, the same family as S3's x-amz-checksum-crc64nvme and NVMe's 64-bit PI guard tag, and values combine linearly. That makes the on-disk checksum metadata a source higher layers can derive range checksums from without rereading data - e.g. serving the RDMA passthrough path's per-stripe CRCs from metadata instead of a second data pass, or matching guard tags on a PI-formatted NVMe-oF namespace. Those consumers need a range-checksum read API, which is left for the ObjectStore read-interface work; this commit makes the stored values the right ones so that data written now benefits later. The synthetic-workload csum matrix in ceph_test_objectstore gains the new algorithm (passes along with the existing six permutations). Blobs written with crc64nvme read as -EOPNOTSUPP on older OSDs, so enabling it is a commitment against downgrade; noted in the release notes. Signed-off-by: Kyle Bader <[email protected]> Assisted-by: claude:claude-fable-5 Signed-off-by: Kyle Bader <[email protected]>
Deriving a range checksum from stored per-block values needs the checksum of unwritten (hole) bytes, which read as zeros. Zero runs are order-independent, so fold in one 2^k-byte run per set bit of the length using the existing combine math - no zero buffer, no O(n) pass. Signed-off-by: Kyle Bader <[email protected]> Assisted-by: claude:claude-fable-5 Signed-off-by: Kyle Bader <[email protected]>
New ObjectStore method: return the checksum of an object range, equal to what checksumming the bytes of read(offset, len) would produce (clamped at object size, holes as zeros). BlueStore derives it purely from stored checksum metadata - no data read - when the blobs store combinable full-width values of the requested type: crc64nvme (canonical values, combined with the carry-less-multiply math) and crc32c (seeded -1, folded with the same zeros-operator identity bufferlist's cached-crc combine uses). xxhash does not combine and the truncated crc32c variants store too little state, so those types are never derived. When the range is not derivable (compressed blobs, another stored csum type, csum-less blobs, partially covered csum blocks), the caller may pass the bytes it already read - the same bufferlist a preceding read() filled, so nothing is copied or reread - and the checksum is computed over them by the base implementation. The return value reports which happened: 0 derived from metadata, 1 computed over the caller's data. With no data supplied the call remains a pure metadata probe returning -EOPNOTSUPP, leaving the fallback strategy with the caller: compute in software over bytes in hand, or let transport hardware (e.g. RDMA NIC signature offload) produce the value in flight. This is the metadata-read seam the RDMA passthrough path and an NVMe-oF 64-bit-PI gateway can serve range checksums from; it is deliberately narrow so the broader ObjectStore read-interface rework can absorb or replace it. The store_test covers whole-object, sub-range, hole, straddling and past-eof ranges for both algorithms against checksums of the actually-read data, the refusal cases, the data fallback (including that derivable ranges still prefer metadata and that errors like ENOENT are not papered over), and that in-place overwrites keep deriving correctly (an existing blob recalculates under its own csum type even when the store default has changed). Signed-off-by: Kyle Bader <[email protected]> Assisted-by: claude:claude-fable-5 Signed-off-by: Kyle Bader <[email protected]>
ObjectOperation::set_rdma_delivery(on_result) stores the result slot in rdma_oob_storage, a deque owned by the ObjectOperation, and hands its address to the Op through rdma_oob_result and to the out handler. The Objecter's read()/prepare_read_op() swap those into the Op and then call op.clear(), which resets rdma_oob_storage and frees the slots while the Op still points at them. The reply handler then writes the delivered byte count into freed memory, and tcmalloc eventually hands that block out again: radosgw crashed in tc_newarray with the freed block's free-list pointer overwritten by a 4 MiB stripe length. Move the storage into the Op with the pointers that reference it. Moving the unique_ptr keeps the slot addresses stable, so the handler captures stay valid; SplitOp writes through orig_op->rdma_oob_result and is covered too. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Kyle Bader <[email protected]>
cuObject 2.x split setTelemFlags() into path flags and op flags and defines CUOBJ_SERVER_MAJOR_VERSION; the 1.x header has one argument and no version macros. Select the call on the macro so radosgw builds against either. Signed-off-by: Kyle Bader <[email protected]>
RGWCuObjServer handed each frontend thread its own cuObject channel on first use and never released it, and did not check the allocation. A channel may not be shared by concurrent callers, but the library only has rgw_cuobj_num_dcis of them (128 by default) while the beast frontend runs rgw_thread_pool_size threads (1024): once the channels ran out, every RDMA transfer on a later thread failed with -EIO in under a millisecond and the PUT came back as a 500. Allocate the channels once at startup into a free list and have each transfer take one for its duration, waiting when none is free. Fail initialization when no channel can be allocated, warn when fewer than configured, and free them at shutdown. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Kyle Bader <[email protected]>
Since isa-l 2.32 the folding CRC kernels include crc_const_extern.asm from the crc directory, which the probe did not put on nasm's include path. The probe therefore always failed, HAVE_NASM_X64_AVX512_VPCLMUL was never set, and the AVX512 crc32c kernel (crc32_iscsi_by16_10) was silently left out of every build. Add the directory to the probe and to the crc32 object library's assembler flags. The kernel's constants live in crc_const.asm; add it when ceph-common is not already linking libisal (which carries them, and which the crc64nvme backend pulls in under WITH_EC_ISA_PLUGIN). Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Kyle Bader <[email protected]>
A shard OSD declines out-of-band delivery for a short window before each read-lease renewal (readable_until on a non-primary shard is the primary's lease minus the clock-delta bound), and returns that stripe inline. RGW treated any inline stripe as a signal that an RDMA write it lost track of might still land, so it waited the pool's delivery lease plus rgw_cuobj_fence_drain_ms (8 s with the defaults) and then restarted the whole GET in staged mode. About 0.25% of GETs paid that 8 s, which set the last-thread completion time of every benchmark. The wait is only needed when the op was sent more than once: a single attempt that replied inline has, by construction, initiated no write. Have the Objecter mark a delivery result FLAG_RESENT when op->attempts is greater than one, propagate it through SplitOp's aggregate, and expose it to librados callers as RDMA_DELIVERY_RESENT. RGW then RDMA-writes a stripe that came back inline from a never-resent op into the client window itself, from a staging buffer, recording its byte count and CRC64 in that stripe's slot; a resent op or a failed patch still takes the fence and the staged restart. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Kyle Bader <[email protected]>
execute_plan() copied every read payload into a pre-registered staging buffer before the NIC read it. On a canister with 4 of 12 DIMM channels populated the copy is a full extra pass of the delivered bytes over the memory bus, and memory bandwidth turned out to be what bounded RDMA reads. Add osd_cuobj_register_in_place: register each buffer of the payload where it lies and issue one RDMA write per buffer, falling back to the copy when a payload is in more than 64 pieces or a registration fails. Staging is restructured around a list of registered segments (staged_payload), and plan_xfers() splits the placement plan so that no write crosses a segment. With 4 MiB BlueStore blobs a 4 MiB shard read arrives as one or two buffers, and the registration costs about 200 us per read; with the default 64 KiB blobs a read arrives in about a dozen pieces and the copy is cheaper, so the option is off by default. On the test canister (6+2, 4 MiB stripe unit, 4 MiB blobs) DRAM traffic per delivered byte fell from about 4.8 passes to about 3 and sustained RDMA GETs from disk went from 24.8 to 26.4 GiB/s. cuobj status gains payload_segments, plans_in_place, plans_copied and register_in_place_ns. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Kyle Bader <[email protected]>
Split deliver_oob()/deliver_op_oob() into oob_delivery_allowed(), which holds the per-request checks (descriptor shape, retries, the read lease, the delivery lease), plan_op_oob(), which builds the placement plan and the payload it indexes for one op, and strip_oob_delivered(), which removes pushed data from the reply. No functional change; a following commit needs the plan builder on its own. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Kyle Bader <[email protected]>
The per-range CRC-64/NVME an OSD returns with an out-of-band delivery was computed over the payload after BlueStore had already read every byte to verify its own checksum: a second pass over the data on a path that memory bandwidth bounds. Turning the second pass off was worth about 17% on the test canister. When the pool's csum_type is crc64nvme, BlueStore stores the canonical CRC-64/NVME of every csum block, and read_range_checksum() folds those into the checksum of any block-aligned range without touching the data. Have plan_op_oob() report where the payload starts in the local (shard) object - the same shard-offset arithmetic as objects_read_local() - and ask the store for each placed range's checksum from metadata alone; only a range it cannot serve (another csum type, a partial csum block, a compressed blob) is hashed from the payload. On a 6+2 pool with a 4 MiB stripe unit about 99% of delivered ranges take their checksum from metadata, and sustained RDMA GETs from disk went from 27-28 to 32-34 GiB/s with the checksum still returned. cuobj status reports crc64_from_metadata and crc64_computed. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Kyle Bader <[email protected]>
When a primary reads an erasure-coded object on behalf of a client, each peer returns its chunks in an MOSDECSubOpReadReply: a messenger copy on the peer, a receive copy on the primary, and the CPU to drive both. Let the peers RDMA-write the chunks into the primary instead. The primary becomes an RDMA target through the client half of cuObject (libcuobjclient, the same role a GPU data loader plays towards RGW): OSDCuObjGather registers one arena and mints one descriptor token for it at startup, then hands out fixed-size slots per sub-read extent. ECSubRead (v5) carries the token and a window offset per extent; a peer that can push does so with the very code path it uses to deliver to a client (OSDCuObj::execute_plan), under the same read-lease and delivery-lease fences, and reports the pushed extents in ECSubReadReply (v4) instead of returning the data. The primary wraps each landed slot as a zero-copy buffer and folds it into the read result as if it had arrived inline. A peer that cannot push replies inline as before. A slot is recycled when the last reference to its buffer drops. One whose push was never confirmed - the peer did not reply, replied with an error, or fell back inline after a failed push - is quarantined for longer than a peer may take to start and finish a write, so a late RDMA write can never land in memory that has been handed to another read. Only client reads use the gather (ReadCompleter::allows_rdma_gather): RMW and recovery reads park their buffers in the extent cache, which would pin slots indefinitely. The build finds the client library next to the CUDA toolkit and enables the role as WITH_OSD_CUOBJ_GATHER (the detection is shared with the gateway, which takes the same role in a later change). Options: osd_cuobj_gather_enabled, _slot_size, _slots, _quarantine, _config. Counters appear under the "gather" section of "cuobj status". On the CS1 canister (16 OSDs, EC 6+2, 24 MiB objects, 64 threads, cold) primary-delivered reads went from 11.1 to 18.5 GiB/s at a 4 MB stripe unit and 9.0 to 12.4 GiB/s at 16 KB, with host CPU dropping from 74% to 22%; with one OSD down, degraded split reads went from 17.9 to 23.6 GiB/s and degraded primary delivery from 9.2 to 16.1 GiB/s. Every run verified end to end with zero checksum mismatches. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Kyle Bader <[email protected]>
In the staged S3-over-RDMA mode the response has no body: the header is the client's signal that the object is in its memory. RGWGetObj committed that header on the first data chunk, as it does for an HTTP body, and performed the single RDMA write into the client only at the end of the request. A client that trusted the response could therefore read a partially written buffer. Nothing on the storage side can see this - the bytes are correct in every buffer the gateway checks - and it went unnoticed until elbencho verified the delivered bytes against x-amz-checksum-crc64nvme and got a different CRC on every attempt. Stage every chunk as it arrives, perform the RDMA write on the final (empty) call, and only then emit the header, which now reports the write's error if it failed. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Kyle Bader <[email protected]>
OSD passthrough takes the gateway off the data path only for clients that can receive RDMA and only for requests that fit the passthrough contract. Everything else - plain HTTP clients, staged S3-over-RDMA requests - still pulls every stripe through the messenger into RGW memory. Give the gateway the same target role an OSD primary now has for its peers. With rgw_cuobj_osd_push the staging pool's buffers get a second registration through the cuObject client library and one descriptor token each. RGWGetObj then attaches a buffer's token to its stripe reads exactly as it would attach a client's, and the OSDs RDMA-write the stripes into the buffer; the OSD side is unchanged. get_obj_data places any stripe that comes back inline itself and hands the callback zero-copy aliases of the buffer in logical order, so an HTTP body streams as stripes land and a staged request ends with the same single RDMA write it always did. A buffer an OSD might still write into (a stripe from a resent op, a fallback after descriptor-bearing ops were sent) is quarantined for the delivery lease plus the transport drain bound instead of making the request wait, since the memory is the gateway's own. The whole-object CRC64-NVME verification of the passthrough path applies unchanged. Options: rgw_cuobj_osd_push, rgw_cuobj_client_config. The build enables the role as WITH_RADOSGW_CUOBJ_TARGET when the client library is found. On the CS1 canister (24 MiB objects, 64 threads, cold) HTTP GETs went from 9.8 to 13.7 GiB/s (14.8 at a 16 KB stripe unit) and staged RDMA GETs from 7.2 to 20.4 GiB/s (20.0 at 16 KB); with one OSD down, 8.9 to 12.4 and 17.8 GiB/s respectively. Verified with the AWS CLI's checksum validation and an independent CRC of the downloaded bytes. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Kyle Bader <[email protected]>
With the gather in place a primary-delivered read's payload is mostly chunks that already sit in registered memory (the peers' slots), plus the primary's own chunk. Delivery still treated the payload as ordinary buffers: at a 4 MB stripe unit it registered each of the six chunks in place per read, and at 16 KB the 9,216-segment rados-order assembly exceeded the in-place limit and was copied into a pooled buffer first. Register the gather arena with the server library once at startup and teach stage_payload about registered regions: a buffer inside one is addressed through the region's handle at its offset, with no registration and no copy. Buffers outside a region are registered per underlying allocation rather than per piece, so the many interleaved pieces of one chunk cost one registration, and transfers are expanded per segment with a deeper submission pipeline for the small-chunk case. On the CS1 canister (24 MiB objects, 64 threads, cold) primary-delivered reads at a 16 KB stripe unit went from 12.4 to 17.8 GiB/s and the cache-resident case from 20.2 to 25.6 GiB/s; 4 MB was unchanged within noise. All runs client-verified with zero mismatches. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Kyle Bader <[email protected]>
…imary An erasure-coded write fans out from the primary to k+m-1 peers as MOSDECSubOpWrite messages carrying each shard's bytes: a messenger send on the primary and a receive copy on every peer. Let the peers pull the bytes instead. The per-shard transactions are now built in the aligned format, whose page-aligned write payload is one headless stream that ops consume positionally. With osd_cuobj_pull_writes the primary takes that stream out of each peer's transaction, registers the allocations under it with the cuObject client library (the data shards are views of the client's buffer, so one registration serves every peer) and sends ECSubWrite (v6) with PUT tokens and (token, offset, length) pieces in stream order. The peer RDMA-reads the pieces into gather slots (OSDCuObj::pull_into, the arena being registered with the server library too), installs the stream and applies the transaction; with buffered writes off BlueStore writes straight out of the slot and drops it after the aio. Registrations are held until the peer's commit reply and quarantined for osd_cuobj_gather_quarantine if the op is dropped first, so no peer can read reused memory; a peer may start a pull up to half that period after receiving the sub-write. A peer that cannot pull (no slot, a transport error) replies pull_failed (ECSubWriteReply v2) and the primary resends the transaction whole. Because the peer must apply sub-writes in log order, it holds every sub-write that arrives behind one it is waiting for and requeues them, in order, once the resend has been applied. On the CS1 canister (24 MiB objects, 128 writers, EC 6+2) RDMA PUTs went from 2.93 to 3.65 GiB/s and HTTP PUTs from 2.88 to 3.47 GiB/s, with no errors and client-verified reads of the written data afterwards. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Kyle Bader <[email protected]>
… client When a primary reads an erasure-coded object for a client that asked for out-of-band delivery, every data shard's chunks travel to the primary and then to the client, and the primary's NIC carries the whole object. With osd_cuobj_fanout_delivery the primary attaches the client's window and the read's logical range to the sub-reads (ECSubRead v7); a peer holding a data shard RDMA-writes its chunks into the client at their logical positions - the same interleave a shard-direct read uses - and reports the ranges and their CRC64-NVME values in the reply (ECSubReadReply v5). It sends the chunks to the primary as well only when a reconstruction needs them, which is the case exactly when a parity shard is being read. The primary aliases a registered block of zeros where peers delivered, so the read result keeps its shape without carrying the bytes, delivers only its own and any reconstructed chunks, and folds every range's checksum into one whole-range value for the client. Peers place under the fences of the client op itself (its retry count, receipt time and the read lease), and never for a retried op. Once a peer has delivered, the read has no inline fallback: a failure of the primary's own delivery fails the read, and the client retries without fan-out. RGW reads objects as stripe-sized ops, most of which start mid-stripe, so the placement accepts any range that starts at a shard's first chunk, not only stripe-aligned ones. On the CS1 canister (24 MiB objects, 64 threads, cold) primary-path reads went from 18.9 to 31.3 GiB/s at a 4 MB stripe unit and from 17.8 to 29.4 GiB/s at 16 KB - the split-read figures - and the cache-resident case reaches line rate (45.2 GiB/s). With one OSD down, degraded primary-path reads went from 16.1 to 26.1 GiB/s, equal to degraded split reads. All runs client-verified. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Kyle Bader <[email protected]>
An S3-over-RDMA PUT so far had the gateway RDMA-read the object out of the client's buffer, checksum it, and send it to the primary over the messenger: two passes over every byte on the gateway, which held it to about 3.5 GiB/s on 22 cores while the OSDs idled. With rgw_cuobj_put_passthrough the gateway never touches the bytes. For a plain object that fits the head object it feeds its pipeline a placeholder of the right length and attaches the client's RDMA token, plus the CRC64-NVME the client sent in x-amz-checksum-crc64nvme, to the head write (ObjectWriteOperation::set_rdma_source, a delivery_t with FLAG_SOURCE; the Objecter strips the placeholder before sending). The primary pulls the payload into its gather arena, verifies the CRC there - a mismatch fails the write with EBADMSG and the PUT with BadDigest before anything is written - reports the CRC back in the oob result, and carries on as if the bytes had arrived inline. The ETag becomes the verified CRC, since there is no MD5 to compute. Any object the gateway cannot hand over (compression, encryption, retention, a checksum the OSD cannot verify, larger than the head) takes the staged path as before. The arena also learns a PUT token of its own, so a peer that pulls its shard of such a write reads it straight out of the primary's slots without a second registration; neorados::Op grows by one word for the larger ObjectOperation. On the CS1 canister, 24 MiB RDMA PUTs at 128 writers went from 3.56 to 9.03 GiB/s with peers pulling from the primary (6.32 on the messenger) and the gateway from 22 cores to one. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Kyle Bader <[email protected]>
…lient When the primary pulled a write payload out of the client itself, the data shards it sends its peers are views of that same client memory, and the primary is one hop too many for them. With osd_cuobj_pull_writes_direct the gather arena remembers, per slot, which client token and offset filled it; prepare_pull hands a peer the client's token for any buffer that is such a view, and only the parity shards (and any padding) still come out of the primary's arena. Nothing changes on the wire: ECSubWrite already carries arbitrary tokens. The trade is client egress for primary egress: the client now serves its k data chunks twice, once to the primary, which still needs all of them to encode, and once to the peers. On the CS1 canister that came to 7.96 GiB/s against 9.03 with the primary as the only source, at 46% instead of 62% host CPU. Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Kyle Bader <[email protected]>
… the primary Pull only once require_osd_release is umbrella: a Tentacle peer decodes ECSubWrite v6 past rdma_pull and would apply a transaction whose data was taken out. And build the decline path (pull_pending, pull_held, send_pull_failed, requeue_held_ops) into every OSD, not just the gather build, so an umbrella peer without the cuObject client replies pull_failed instead of applying t without its payload. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Kyle Bader <[email protected]>
The cuObject endpoints bind to one explicit address per daemon (osd_cuobj_rdma_ip, rgw_cuobj_rdma_ip), so configuring a cluster means a per-host setting on every OSD and gateway. Add rdma_network, the RDMA counterpart of public_network: a comma-separated list of subnets from which a daemon without an explicit address picks a local one. A rail-optimized fabric lists one subnet per rail; an OSD with addresses on several rails prefers the interface on its object store's NUMA node when osd_numa_prefer_iface is set, the rule its public address already follows. An explicit address still wins. Unlike public_network, an entry that does not parse, or a host with no address in the list, costs the daemon its RDMA endpoint rather than stopping it: the OSD delivers every read inline and the gateway runs without its RDMA server. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Kyle Bader <[email protected]>
…ress Add rdma_network_interface, the counterpart of public_network_interface and cluster_network_interface: it narrows rdma_network's candidates to the named interfaces. Set without rdma_network it logs an error and leaves the daemon without its RDMA endpoint, rather than exiting as find_ip_in_subnet_list would. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Kyle Bader <[email protected]>
…work rdma_network names the address a daemon's cuObject server binds, but the OSD gather arena and radosgw's push target also build a cuObject client, and that library takes its NICs only from rdma_dev_addr_list in cufile.json: no API or environment variable sets them. So every host still needed a hand-written file. When rdma_network is set and the deployment names no file of its own (CUFILE_ENV_PATH_JSON, osd_cuobj_gather_config, rgw_cuobj_client_config), copy /etc/cufile.json with rdma_dev_addr_list replaced by the daemon's RDMA address to $run_dir/$cluster-$name.cufile.json and export that path. The host file's other settings (DMABuf, DC key, logging) carry over; its // comments, which NVIDIA ships and json_spirit rejects, are stripped first. The run directory, not /etc/ceph, because the daemons run as ceph and one file per daemon lets OSDs on different rails name different NICs. The OSD resolves its RDMA address once for both the server and the gather, so the arena registers on the same NIC the endpoint pushes from. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Kyle Bader <[email protected]>
357111e to
b20c56c
Compare
|
Closing in favor of the successor - #73164 |
This is a variant of #70458 (which it includes as its first commit) that moves the GET
data path off the gateway entirely, evolved after architecture review into a generic
out-of-band delivery layer for RADOS reads.
Instead of staging the object in RGW memory and issuing one RDMA_WRITE from the
gateway's cuObjServer, RGW forwards the client's opaque
x-amz-rdma-tokento theOSDs: each stripe read carries an advisory delivery descriptor — a first-class,
versioned field on
MOSDOp(v10) holding the token, the stripe's offset within therequested range, and a lease. An OSD that can push builds an op-aware placement plan
and RDMA-writes the reply data straight into client memory — including GPU memory via
GPUDirect — and the reply (v9) reports per-op pushed byte counts in a new
oob_bytesvector. An OSD that cannot push — older release, built without cuObject, disabled,
expired lease, retransmitted request, unknown flags — returns the data inline as a
perfectly normal read. Every degradation path is plain, correct, in-band data:
there is no protocol error to handle and mixed-version clusters need no ceremony.
This matches the cuObject architecture's reference data flow — NVIDIA's docs describe
the S3 gateway "instruct[ing] specific data nodes" which "push the data via RDMA
(RDMA_WRITE) directly to the client GPU or system memory" [1]. The DC transport makes
the descriptor location-independent: any node holding the token and the cluster
dc_keycan write into the client's registered window, with the library validatingevery write against the token's range. Benefits over the staged mode:
handles control plane only, and in passthrough deployments needs no RDMA NIC and
no cuObject library at all (only the OSDs do;
cuobjserverrequires no GPU).Placement: op-aware plans, generic transport
All successful data-bearing read replies funnel through one reply-time chokepoint,
where the OSD builds a placement plan and a batched-async cuObject executor pushes it:
reply is already reconstructed logical data, so plain EC pools work for the RGW
path with no client changes at all;
of band);
OSD scatters its ~16K chunks to their logical positions in the client window, so
the shards' concurrent writes interleave into the client's buffer and client-side
reassembly disappears into the NIC's address arithmetic.
The plan builders are pure functions unit-tested against the client-side stripe walk
(
ECStripeIterator) as the oracle across 200+ randomized geometries. SplitOp fansthe descriptor out: replica sub-reads get the window shifted to their own origin, EC
direct sub-reads share it; mixed inline/OOB sub-replies retry to the primary, where
the resend is guaranteed inline. The series also carries a standalone fix for a
pre-existing SplitOp replica-slicing bug (chunk count could exceed the OSD count,
wrapping the round-robin and silently overwriting a sub-read's data through aliased
out-buffers).
Correctness: the lease + interlock scheme
One-sided RDMA plus an at-least-once RPC layer needs explicit fencing:
the interlock for every OSD still in contact; RGW drains all stripe ops before
any HTTP response (the client's only completion signal).
across peering changes.
rgw_cuobj_lease_ms,default 5s) bounding how long after receipt a write may still start; RGW fences
fallback restarts with
rgw_cuobj_fence_wait_ms(default 3s, sized to the RDMAtransport's retry budget) so no stale write can land after the fallback rewrites
the same client ranges. The lease is wall-clock and documented as best-effort
across clock steps.
cuobj statusOSD admin-socket command exposes plan/byte/in-flight counters.Wire compatibility: the descriptor encodes only to
SERVER_UMBRELLApeers and theObjecter refuses to attach it unless
require_osd_release >= umbrella(older OSDsgarbage-decode unknown MOSDOp versions, so both gates are load-bearing); the reply's
oob_bytesis trailing and downgrade-safe. librados gainsObjectReadOperation::set_rdma_delivery()(C++ only,omap_rm_rangeprecedent).RGW behavior
rgw_cuobj_osd_passthroughgates a per-request mode ladder: passthrough → (on anyinline stripe) whole-GET restart in the staged mode from the base integration →
plain HTTP body with
x-amz-rdma-reply: 501. Eligibility: plain objects only (nocompression/encryption/lua/flight), no DLO/SLO, no d3n, response fits the client
window; replicated and EC pools both qualify. Multipart and range GETs use the
ordinary manifest walk; the existing 16MiB aio window throttles OSD-side RDMA
pressure per client NIC. RDMA bytes are accounted in the access, ops and usage logs
toward the direction the data actually moved.
Testing
unittest_rdma_delivery— pins the descriptor's exact wire bytes.unittest_oob_placement— pins the EC interleave against the client stripe-walkoracle (randomized geometries).
unittest_rdma_token— token parsing.ceph_test_rados_api_misc_ppgainsRdmaDeliveryInlineFallbackPP, pinning theinline-degradation contract the RGW fallback keys on; the full suite (EC fixtures
included) passes against a 3-OSD vstart cluster over the new wire, no RDMA
hardware required.
cuobjserverpackage; vstart recipe in
doc/radosgw/s3-rdma.rst— same client procedure asrgw: add experimental cuObject S3 RDMA server support #70458 (
s3perf.js --rdma), plus-o rgw_cuobj_osd_passthrough=trueand-o osd_cuobj_enabled=true.Limitations / follow-ups
already batched asynchronously); moving it fully off the reply path is planned.
planned fix registers the BlueStore hugepage read-buffer pool (blk, os/bluestore: introduce huge page-based read buffers #43849's
ExplicitHugePagePool) with the NIC for per-segment zero copy.(DC target + per-op range validation; NooBaa's server does offset-addressed
partial writes with one token in production) but NVIDIA's docs never state it in
one sentence — the first hardware PoC should validate a 2-OSD GET before this
graduates from RFC.
[1] https://docs.nvidia.com/gpudirect-storage/cuobject/index.html §1.3.3
Checklist