Skip to content

fix(compile): preserve remote pipeline error causes - #27150

Merged
XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
aunjgr:fix/27115-remote-error-cause
Aug 14, 2026
Merged

XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
aunjgr:fix/27115-remote-error-cause

Conversation

@aunjgr

@aunjgr aunjgr commented Aug 14, 2026

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:

Fixes #27115

What this PR does / why we need it:

Remote pipeline cancellation could replace a substantive execution failure, such as a duplicate-key error, with query interrupted and then suppress it. That allowed a failed multi-CN INSERT to be reported as successful.

This change:

  • resolves remote-run cancellation through the pipeline CancelCause before operator cleanup mutates the context;
  • applies the same cause-aware handling to remote receiver notification failures;
  • preserves raw registration-retry cancellation when no stronger cause exists; and
  • adds regressions for substantive and ordinary cancellation through both remote paths.

Validation:

  • focused cancellation/error propagation tests;
  • full pkg/sql/compile unit-test package;
  • affected tests under -race -count=100;
  • full package race suite with three unrelated parquet fanout tests excluded; those three failures reproduce unchanged on pristine upstream/main;
  • go vet ./pkg/sql/compile and git diff --check.

@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 →

@aptend aptend 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 completed on exact head 85ff199ae208747bcea6032824d118f2820b5d7e.

The change correctly reuses the established cause-aware scope normalization before remote root cleanup can mutate the pipeline context. Substantive cancellation causes survive both RemoteRun and remote receiver-notification failures; normal internal QueryInterrupted fallout remains suppressible; raw registration-retry cancellation keeps its historical classification when there is no stronger cause; mixed/substantive errors and query-owned deadline/cancellation behavior remain unchanged.

I traced the remote send/receive, pipeline/context ownership, sibling cancellation, root cleanup, notify retry, terminal-signal, and MergeRun result-collection paths. The focused new tests plus existing primary-error/cancellation controls pass with the required CGO/thirdparties setup, all required GitHub checks are green, and git diff --check is clean. No blocking findings.

@mergify

mergify Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Queued — the merge queue status continues in this comment ↓.

@mergify

mergify Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-08-14 08:32 UTC · Rule: main · triggered by @aunjgr with the merge queue checkbox
  • 🟠 Checks running · in-place
  • 🚫 Left the queue — 2026-08-14 10:30 UTC · at c8e79f2564710eb3a3d1b1edd2c2846bd4bd0e11

This pull request spent 1 hour 57 minutes 45 seconds in the queue, with no time running CI.

Waiting for any of
  • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
  • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
  • check-success = Matrixone CI / UT Test on Ubuntu/x86
All conditions
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
  • #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 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 Utils CI / Coverage
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-neutral = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
    • check-skipped = Matrixone UT Coverage / UT Coverage on Ubuntu/x86
  • 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)

Reason

Pull request #27150 has been dequeued

Pull request from fork cannot be queued. This pull request comes 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.

Failing checks:

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, 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

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

@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 completed on exact head c8e79f2564710eb3a3d1b1edd2c2846bd4bd0e11.

No blocking findings. The change resolves the cancellation cause before CleanRootOperator can mutate the pipeline context, so a substantive remote execution error is preserved through both RemoteRun and receiver-notification failure paths. Normal internal QueryInterrupted fallout remains secondary, query-owned cancellation/deadline classification is preserved, raw registration-retry cancellation remains visible when no stronger cause exists, and independent/non-cancellation errors are not rewritten.

I traced context ownership, remote send/receive, sibling cancellation, notify retry, cleanup terminal delivery, and MergeRun result collection. Validation on this exact head: git diff --check; go list, go build, and go vet for ./pkg/sql/compile; the two new regression tests at -count=100; the same tests under -race -count=100; and the full ./pkg/sql/compile test package. All passed.

@XuPeng-SH
XuPeng-SH merged commit d80d98e into matrixorigin:main Aug 14, 2026
32 checks passed
@mergify mergify Bot added dequeued and removed queued labels Aug 14, 2026
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:

Fixes matrixorigin#27115

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

Remote pipeline cancellation could replace a substantive execution
failure, such as a duplicate-key error, with `query interrupted` and
then suppress it. That allowed a failed multi-CN INSERT to be reported
as successful.

This change:

- resolves remote-run cancellation through the pipeline `CancelCause`
before operator cleanup mutates the context;
- applies the same cause-aware handling to remote receiver notification
failures;
- preserves raw registration-retry cancellation when no stronger cause
exists; and
- adds regressions for substantive and ordinary cancellation through
both remote paths.

Validation:

- focused cancellation/error propagation tests;
- full `pkg/sql/compile` unit-test package;
- affected tests under `-race -count=100`;
- full package race suite with three unrelated parquet fanout tests
excluded; those three failures reproduce unchanged on pristine
`upstream/main`;
- `go vet ./pkg/sql/compile` and `git diff --check`.

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:

Fixes matrixorigin#27115

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

Remote pipeline cancellation could replace a substantive execution
failure, such as a duplicate-key error, with `query interrupted` and
then suppress it. That allowed a failed multi-CN INSERT to be reported
as successful.

This change:

- resolves remote-run cancellation through the pipeline `CancelCause`
before operator cleanup mutates the context;
- applies the same cause-aware handling to remote receiver notification
failures;
- preserves raw registration-retry cancellation when no stronger cause
exists; and
- adds regressions for substantive and ordinary cancellation through
both remote paths.

Validation:

- focused cancellation/error propagation tests;
- full `pkg/sql/compile` unit-test package;
- affected tests under `-race -count=100`;
- full package race suite with three unrelated parquet fanout tests
excluded; those three failures reproduce unchanged on pristine
`upstream/main`;
- `go vet ./pkg/sql/compile` and `git diff --check`.

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:

Fixes matrixorigin#27115

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

Remote pipeline cancellation could replace a substantive execution
failure, such as a duplicate-key error, with `query interrupted` and
then suppress it. That allowed a failed multi-CN INSERT to be reported
as successful.

This change:

- resolves remote-run cancellation through the pipeline `CancelCause`
before operator cleanup mutates the context;
- applies the same cause-aware handling to remote receiver notification
failures;
- preserves raw registration-retry cancellation when no stronger cause
exists; and
- adds regressions for substantive and ordinary cancellation through
both remote paths.

Validation:

- focused cancellation/error propagation tests;
- full `pkg/sql/compile` unit-test package;
- affected tests under `-race -count=100`;
- full package race suite with three unrelated parquet fanout tests
excluded; those three failures reproduce unchanged on pristine
`upstream/main`;
- `go vet ./pkg/sql/compile` and `git diff --check`.

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.

[Bug]: multi-CN remote pipeline can report duplicate-key INSERT as success

4 participants