googleapis / googleapis/google-cloud-rust

Partial-resume skips the wrong bytes in the buffered uploader

Open Beginner friendly
#6,683 0 comments 0 reactions 0 assignees View on GitHub
api: storage type: bug
Dominant language
Rust
Stars
955
Forks
144
Avg merge
1d 5h
Merged PRs (30d)
279

Description

Unconfirmed. This is the result of a search with Claude, may be a false positive.

After a 308 Resume Incomplete response with `persisted_size` strictly inside the current chunk, `handle_partial` must drop the first `s` already-persisted bytes of a `Bytes` element of length `n`.

However, in `src/storage/src/storage/perform_upload/buffered/progress.rs`:

https://github.com/googleapis/google-cloud-rust/blob/f02b42c2ac5720334cd2b5335824bd4166264527/src/storage/src/storage/perform_upload/buffered/progress.rs#L201-L204

The code performs `b.split_off(n - s)`, which returns the last `s` bytes rather than dropping the first `s` bytes and retaining the remaining `n - s` bytes. Unless `s == n / 2`, the resent data contains the wrong bytes and the wrong length, corrupting the object payload upon completion.

Contributor guide

Open the contributing guide

Research direction

Start in src/storage/src/storage/perform_upload/buffered/progress.rs at handle_partial and inspect the 308 Resume Incomplete path when persisted_size falls inside a Bytes element. Verify the retained bytes are the portion after the persisted prefix, then run the relevant storage tests. Done means partial resumes resend the correct remaining bytes without corrupting the payload.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cloud
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.