Skip to content

fix(fileservice): retry COS multipart init on EOF - #26739

Merged
XuPeng-SH merged 7 commits into
matrixorigin:mainfrom
jiangxinmeng1:fix/cos-multipart-init-eof-retry
Aug 6, 2026
Merged

XuPeng-SH merged 7 commits into
matrixorigin:mainfrom
jiangxinmeng1:fix/cos-multipart-init-eof-retry

Conversation

@jiangxinmeng1

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #25114

What this PR does / why we need it:

fix(fileservice): retry COS multipart init on EOF

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep review of exact head 5268ba72f34ddfacf3624fedf322ee9290c06146.

The focused test and the complete pkg/fileservice suite pass, but the new retry policy has one P1 ownership blocker.

P1 — A raw EOF after COS has committed multipart initialization leaks an unreachable UploadID.

InitiateMultipartUpload is a state-creating POST and has no idempotency key in this call. EOF does not prove that the request was rejected: the server may have created an UploadID and the response can be lost afterward. Retrying then creates another UploadID. The caller only receives the later ID, so the existing completion/abort defer can never clean up the first one. With the 128-attempt loop, one write can leave many server-side multipart sessions behind.

I reproduced this through WriteMultipartParallel on this exact head with a mock COS service that returns a unique ID per init. The first request was fully processed as upload-1, then its successful response was converted to EOF; retry created and successfully completed upload-2. The write returned nil while the server still had upload-1 active. The new checked-in transport test only returns EOF before forwarding the request to the server, so it cannot exercise this ambiguous-commit half of the state space.

Please do not classify an undifferentiated EOF as safely retryable for this non-idempotent operation unless there is a recovery/idempotency protocol that also owns every earlier committed ID. Add the post-commit/response-lost case and assert no orphan remains; preserve the existing pre-commit EOF case as its control.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after rechecking the exact head.

The previous orphan-UploadID concern is closed by removing retry around the non-idempotent multipart-init operation; the QCloud SDK client also keeps its internal retry count at zero. This is the correct conservative ownership contract because a response-lost error cannot prove whether COS committed an UploadID.

The focused tests passed for both a pre-request EOF and response loss after the server committed the init, including EOF, unexpected EOF, timeout, connection reset, broken pipe, and server-closed variants; every case remains a single init attempt.

@mergify mergify Bot added the queued label Aug 6, 2026
@mergify

mergify Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-08-06 11:52 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-08-06 12:34 UTC · at 8aa5e35b9cee1d74efeb0d600155008e86655a98

This pull request spent 41 minutes 40 seconds in the queue, with no time running CI.

Reason

The pull request can't be updated

This pull request seems to come from a fork, and Mergify needs the author's permission to update its branch.
The author needs to enable "Allow edits from maintainers" on this pull request, or update the branch manually.

Hint

You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

@XuPeng-SH
XuPeng-SH merged commit 998815d into matrixorigin:main Aug 6, 2026
23 of 24 checks passed
@mergify mergify Bot added dequeued and removed queued labels Aug 6, 2026
XuPeng-SH added a commit that referenced this pull request Aug 28, 2026
## What type of PR is this?

- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue #26720

## What this PR does / why we need it:

Backport the fixes missing from `4.2-dev` for
[#26720](#26720) and
  [#25114](#25114).

  Included PRs:

  - #26711: Fix pipeline remote batch backpressure
  - #26739: Retry COS multipart initialization on EOF
  - #26759: Fix IVF prefilter OOM
  - #26989: Reduce IVF prefilter scan memory copies
  - #27156: Keep connections alive after long-running requests

The changes address vector-index memory usage, file-service retry
behavior, remote pipeline backpressure, and
  frontend connection lifecycle on `4.2-dev`.

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: XuPeng-SH <[email protected]>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#25114

## What this PR does / why we need it:

fix(fileservice): retry COS multipart init on EOF

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#25114

## What this PR does / why we need it:

fix(fileservice): retry COS multipart init on EOF

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

issue matrixorigin#25114

## What this PR does / why we need it:

fix(fileservice): retry COS multipart init on EOF

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants