Skip to content

[stable33] fix(ObjectStore): reset multipart upload byte counter on retry - #62995

Merged
AndyScherzinger merged 1 commit into
stable33from
backport/62919/stable33
Aug 7, 2026
Merged

[stable33] fix(ObjectStore): reset multipart upload byte counter on retry#62995
AndyScherzinger merged 1 commit into
stable33from
backport/62919/stable33

Conversation

@backportbot

@backportbot backportbot Bot commented Aug 6, 2026

Copy link
Copy Markdown

Backport of PR #62919

writeMultiPart() initializes $totalWritten once outside the retry loop,
so bytes from a failed first attempt accumulate into the second attempt.
Since $state is never resumed, each retry rewinds the stream and
re-uploads the whole object from scratch, making before_complete compare
roughly twice the object size against the expected size. The retry then
always fails with "Incomplete multi part upload, expected X bytes,
wrote 2X" and the upload is aborted.

Reset the counter per attempt so the size check validates only the
bytes written by the current attempt.

Fixes #59505

Signed-off-by: Ching Kuo <igene@igene.tw>
Assisted-by: Claude Code:claude-fable-5
@backportbot
backportbot Bot requested a review from a team as a code owner August 6, 2026 23:42
@backportbot
backportbot Bot requested review from CarlSchwan, come-nc, cristianscheid, leftybournes, provokateurin, salmart-dev and susnux and removed request for a team August 6, 2026 23:42
@backportbot backportbot Bot added bug 3. to review Waiting for reviews labels Aug 6, 2026
@backportbot backportbot Bot added this to the Nextcloud 33.0.8 milestone Aug 6, 2026
@leftybournes
leftybournes enabled auto-merge August 7, 2026 00:13
@AndyScherzinger
AndyScherzinger merged commit 1040591 into stable33 Aug 7, 2026
172 of 177 checks passed
@AndyScherzinger
AndyScherzinger deleted the backport/62919/stable33 branch August 7, 2026 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants