fix: Stat() returns Size 0 for RDMA GET objects - #2263
Conversation
The RDMA GET fast path in GetObject builds the returned Object with
isClosed=true, objectInfoSet=true and the transferred ObjectInfo (the
payload is delivered out-of-band over RDMA, so there is no streaming
body). Object.Stat() short-circuited on o.isClosed and returned an empty
ObjectInfo{} (Size 0) before reaching the cached objectInfo, so every
RDMA GET reported Size 0 despite a full transfer.
Return the cached objectInfo when objectInfoSet is set, before the
isClosed check. Error-closed objects are still caught first by prevErr,
so existing semantics are preserved.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesObject Stat behavior
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Updates github.com/minio/minio-go/v7 to include minio/minio-go#2263, which fixes Object.Stat() returning Size 0 for RDMA GET objects. Without it, 'warp get --rdma' reports a spurious 'unexpected download size, got:0' on every RDMA GET because the object is created closed and Stat() short- circuited on isClosed before returning the cached ObjectInfo.
Problem
The RDMA
GetObjectfast path (api-get-object.go, gated onopts.RDMABuffer != nil && c.rdmaEnabled) builds the returned*ObjectwithisClosed: true,objectInfoSet: trueandobjectInfo{Size: n}— the payload is delivered out-of-band over RDMA, so there is no streaming HTTP body to read.Object.Stat()short-circuits ono.isClosed:so
Stat().Sizeis always 0 for an RDMA GET, even though the transfer moved the full object. Callers that validate the returned size (e.g. warp--rdma) see a spuriousunexpected download size, got:0on every RDMA GET.Fix
Return the cached
objectInfowhenobjectInfoSetis true, before theisClosedcheck. Error-closed objects are still caught first by theprevErrguard, so existing semantics are preserved.Testing
Validated against an RDMA-capable MinIO AIStor endpoint with warp
--rdma=cpu(256 MiB objects, coe cluster):unexpected download sizeerrors went from 100% of RDMA GETs to 0 at concurrency 4 and 32; GET throughput 7.0 GiB/s (c4) / 36.2 GiB/s (c32), 0 PUT errors.go build ./...,go vet, gofmt clean.Summary by CodeRabbit