Skip to content

fix(compile): normalize remote notify cancellation - #27537

Merged
mergify[bot] merged 1 commit into
matrixorigin:mainfrom
aptend:fix/27261-normalize-notify-cancel
Aug 24, 2026
Merged

mergify[bot] merged 1 commit into
matrixorigin:mainfrom
aptend:fix/27261-normalize-notify-cancel

Conversation

@aptend

@aptend aptend commented Aug 24, 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 #27261

What this PR does / why we need it:

A downstream early stop can cancel a remote-notify pipeline while the query context remains active. The shared cancellation normalizer correctly classifies the resulting raw context.Canceled as secondary pipeline fallout, but the notify path restored that raw error and failed the whole query.

This change makes remote-notify cleanup use the normalized result consistently. Substantive pipeline causes, query-level cancellation, and independent cancellation while the pipeline is active remain visible; only cancellation caused by normal pipeline teardown is suppressed.

It also corrects the retry-cancellation test so it cancels the query context it claims to cover, and adds controls for pipeline cancellation, query cancellation, active-pipeline cancellation, and substantive causes.

Validation:

  • focused cancellation regressions, count=100
  • focused race tests, count=100 per test
  • full pkg/sql/compile unit-test package
  • full pkg/sql/compile race suite
  • go build and go vet for pkg/sql/compile

@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 completed on exact head 306ccdbb176cd3597de8e9088c2fdb3d43c9adc9. No blocking issue found.

The notify cleanup path now consumes normalizeScopeRunError consistently instead of restoring a raw context.Canceled after the normalizer has proven it to be secondary pipeline fallout. The fatal boundaries remain intact: a substantive pipeline cancel cause is recovered; query-context cancellation/deadline remains visible; cancellation while the pipeline is still active is not suppressed; mixed/substantive error trees never classify as cancellation-only. The corrected retry test now cancels the actual query context, so it no longer encodes the old bug as expected behavior.

The change adds no new goroutine, channel, timer, allocation, or retry edge. Q1-Q3 remain closed: every notify task still emits one bounded cleanup terminal/result and calls wg.Done; sibling cancellation occurs only for a non-nil normalized error; and the retry wait remains query-context bounded. Fresh full compile tests, focused race tests for 50 repetitions, build, vet, and diff checks pass.

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

mergify Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-08-24 08:06 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged — 2026-08-24 08:07 UTC · at 306ccdbb176cd3597de8e9088c2fdb3d43c9adc9 · squash

This pull request spent 22 seconds in the queue, including 3 seconds 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 / 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 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)

@mergify
mergify Bot merged commit 53f6aa6 into matrixorigin:main Aug 24, 2026
26 of 27 checks passed
@mergify mergify Bot removed the queued label Aug 24, 2026
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
A downstream early stop can cancel a remote-notify pipeline while the query context remains active. The shared cancellation normalizer correctly classifies the resulting raw context.Canceled as secondary pipeline fallout, but the notify path restored that raw error and failed the whole query.

This change makes remote-notify cleanup use the normalized result consistently. Substantive pipeline causes, query-level cancellation, and independent cancellation while the pipeline is active remain visible; only cancellation caused by normal pipeline teardown is suppressed.

It also corrects the retry-cancellation test so it cancels the query context it claims to cover, and adds controls for pipeline cancellation, query cancellation, active-pipeline cancellation, and substantive causes.

Validation:

- focused cancellation regressions, count=100
- focused race tests, count=100 per test
- full pkg/sql/compile unit-test package
- full pkg/sql/compile race suite
- go build and go vet for pkg/sql/compile

Approved by: @XuPeng-SH
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
A downstream early stop can cancel a remote-notify pipeline while the query context remains active. The shared cancellation normalizer correctly classifies the resulting raw context.Canceled as secondary pipeline fallout, but the notify path restored that raw error and failed the whole query.

This change makes remote-notify cleanup use the normalized result consistently. Substantive pipeline causes, query-level cancellation, and independent cancellation while the pipeline is active remain visible; only cancellation caused by normal pipeline teardown is suppressed.

It also corrects the retry-cancellation test so it cancels the query context it claims to cover, and adds controls for pipeline cancellation, query cancellation, active-pipeline cancellation, and substantive causes.

Validation:

- focused cancellation regressions, count=100
- focused race tests, count=100 per test
- full pkg/sql/compile unit-test package
- full pkg/sql/compile race suite
- go build and go vet for pkg/sql/compile

Approved by: @XuPeng-SH
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
A downstream early stop can cancel a remote-notify pipeline while the query context remains active. The shared cancellation normalizer correctly classifies the resulting raw context.Canceled as secondary pipeline fallout, but the notify path restored that raw error and failed the whole query.

This change makes remote-notify cleanup use the normalized result consistently. Substantive pipeline causes, query-level cancellation, and independent cancellation while the pipeline is active remain visible; only cancellation caused by normal pipeline teardown is suppressed.

It also corrects the retry-cancellation test so it cancels the query context it claims to cover, and adds controls for pipeline cancellation, query cancellation, active-pipeline cancellation, and substantive causes.

Validation:

- focused cancellation regressions, count=100
- focused race tests, count=100 per test
- full pkg/sql/compile unit-test package
- full pkg/sql/compile race suite
- go build and go vet for pkg/sql/compile

Approved by: @XuPeng-SH

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/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IVF CREATE INDEX 第 3 个被 context canceled,导致后续 fulltext index 未创建,ANLI nqft/qft 99% 失败

3 participants