Skip to content

fix(compile): keep remote receiver stop non-terminal - #28128

Merged
mergify[bot] merged 1 commit into
matrixorigin:4.2-devfrom
jiangxinmeng1:backport/pr-28072-4.2-dev
Sep 4, 2026
Merged

mergify[bot] merged 1 commit into
matrixorigin:4.2-devfrom
jiangxinmeng1:backport/pr-28072-4.2-dev

Conversation

@jiangxinmeng1

Copy link
Copy Markdown
Contributor

(cherry picked from commit a2db35f)

What type of PR is this?

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

Which issue(s) this PR fixes:

issue #27757

What this PR does / why we need it:

Fix remote pipeline cancellation handling for issue #27757.

This change distinguishes receiver-driven StopSending from actual query or connection cancellation:

Treat internal downstream early-stop, such as LIMIT, as successful and allow connection reuse.

Keep query cancellation and connection cancellation terminal, returning an error and poisoning the
connection.

Keep substantive remote execution errors terminal.

Preserve the first terminal batch-flow classification to avoid cancellation races.

Add regression tests covering internal early-stop, query cancellation, connection cancellation, and
substantive errors.

@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-reviewed the 4.2 backport at exact head 8641c27 against 4.2-dev@4f62825d33425c5d5253f94b8ad37d41357aa7ab.\n\nThe cherry-pick has the same stable patch-id as main commit a2db35f, and the 4.2 branch contains the required stream reuse, batch-credit, pending-StopSending tombstone, and pipeline/query cancellation separation.\n\nCounterexamples checked: receiver stop before/after lifecycle registration, receiver stop racing query cancellation or connection closure, a substantive execution error racing cancellation, repeated terminal events, late ACK, and protocol/FIN cleanup. Receiver-driven stop is suppressed only while both external contexts remain active and the first recorded cause is cancellation-shaped; query/connection cancellation and substantive errors remain terminal. First-terminal classification is mutex-serialized.\n\nLifecycle audit: no new resource owner; StopSending clears bounded pending credits and notifies all drain waiters; context cancellation and the existing 30-second FIN boundary terminate remaining waits; pending accounting remains capped at 8 batches / 64 MiB. The added terminal mutex read is off the batch hot path and has no material performance impact.\n\nExact-head UT, SCA, coverage, shared build, connector, and BVT checks are green; git diff --check passes. No blocking correctness, liveness, resource, compatibility, or performance issue found.\n\nThis addresses the receiver-stop misclassification, but #27757 should remain open until the real 10M IVFFlat workload is repeated with zero cancellation/RPC errors.

@mergify mergify Bot added the queued label Sep 4, 2026
@mergify

mergify Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-09-04 08:17 UTC · Rule: release-4.2 · triggered by rule Automatic queue on approval for release-4.2
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged — 2026-09-04 08:17 UTC · at 572a89fe96d99ff5d303e691735494012ea31ea2 · squash

This pull request spent 30 seconds in the queue, including 1 second running CI.

Required conditions to merge
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / SCA Test on Linux/arm64
    • check-neutral = Matrixone CI / SCA Test on Linux/arm64
    • check-skipped = Matrixone CI / SCA Test on Linux/arm64
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Utils CI / Coverage
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PROXY)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-neutral = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / multi CN e2e BVT Test on Linux/x64(COMPOSE, PESSIMISTIC)

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