Skip to content

fix: Stat() returns Size 0 for RDMA GET objects - #2263

Merged
harshavardhana merged 1 commit into
minio:masterfrom
harshavardhana:fix/rdma-get-stat-size
Jul 20, 2026
Merged

harshavardhana merged 1 commit into
minio:masterfrom
harshavardhana:fix/rdma-get-stat-size

Conversation

@harshavardhana

@harshavardhana harshavardhana commented Jul 20, 2026 •

Copy link
Copy Markdown
Member

Problem

The RDMA GetObject fast path (api-get-object.go, gated on opts.RDMABuffer != nil && c.rdmaEnabled) builds the returned *Object with isClosed: true, objectInfoSet: true and objectInfo{Size: n} — the payload is delivered out-of-band over RDMA, so there is no streaming HTTP body to read.

Object.Stat() short-circuits on o.isClosed:

if o.prevErr != nil && o.prevErr != io.EOF || o.isClosed {
    return ObjectInfo{}, o.prevErr   // Size 0, nil
}
...
return o.objectInfo, nil             // never reached for RDMA

so Stat().Size is 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 spurious unexpected download size, got:0 on every RDMA GET.

Fix

Return the cached objectInfo when objectInfoSet is true, before the isClosed check. Error-closed objects are still caught first by the prevErr guard, 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 size errors 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

  • Bug Fixes
    • Fixed object status retrieval after closure.
    • Cached object information is now returned when available, including for RDMA GET operations.
    • Improved handling of closed objects without previously stored status information.

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.
@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: bfef9a24-399f-4d98-97fe-7735b63d2f3c

📥 Commits

Reviewing files that changed from the base of the PR and between c30a92d and 0cdfeb8.

📒 Files selected for processing (1)
  • api-get-object.go

📝 Walkthrough

Walkthrough

Object.Stat now preserves cached ObjectInfo after closure, while retaining prior-error handling and empty results for closed objects without cached metadata.

Changes

Object Stat behavior

Layer / File(s) Summary
Stat cached metadata control flow
api-get-object.go
Object.Stat returns saved non-EOF errors first, then cached ObjectInfo when available, and otherwise handles closed objects as before.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: jiuker

Poem

I’m a rabbit with metadata tucked away,
Cached before closing, safe for another day.
Errors still hop to the front of the queue,
Empty stays empty when there’s nothing new.
Sniff, sniff—the Stat path now knows what to do!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main fix: Stat() returning size 0 for RDMA GET objects.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@harshavardhana
harshavardhana merged commit ab51b38 into minio:master Jul 20, 2026
9 checks passed
@harshavardhana
harshavardhana deleted the fix/rdma-get-stat-size branch July 20, 2026 01:34
harshavardhana added a commit to minio/warp that referenced this pull request Jul 20, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant