Skip to content

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

Merged
leftybournes merged 1 commit into
stable34from
backport/62919/stable34
Aug 7, 2026
Merged

[stable34] fix(ObjectStore): reset multipart upload byte counter on retry#62994
leftybournes merged 1 commit into
stable34from
backport/62919/stable34

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 added bug 3. to review Waiting for reviews labels Aug 6, 2026
@backportbot backportbot Bot added this to the Nextcloud 34.0.3 milestone Aug 6, 2026
@leftybournes
leftybournes enabled auto-merge August 7, 2026 00:13
@leftybournes
leftybournes merged commit 6db9f3c into stable34 Aug 7, 2026
210 of 213 checks passed
@leftybournes
leftybournes deleted the backport/62919/stable34 branch August 7, 2026 02:28
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.

3 participants