Skip to content

fix(frontend/compile): reset PipelineEdge terminal state on compiled scope reuse to fix TPCC regression - #25623

Merged
mergify[bot] merged 4 commits into
matrixorigin:mainfrom
ck89119:issue-25614-main
Jul 11, 2026
Merged

mergify[bot] merged 4 commits into
matrixorigin:mainfrom
ck89119:issue-25614-main

Conversation

@ck89119

@ck89119 ck89119 commented Jul 11, 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:

issue #25614

What this PR does / why we need it:

Issue #25614: prepared UPDATE...JOIN hang fix (commit 5222247 / PR #25562) forced per-execution recompilation of the compiled scope tree, causing a 25% TPCC tpmC regression.

Root cause of the hang: not in hashbuild operator state but in PipelineEdge (WaitRegister) persistent terminal state (doneClosed/endDelivered/fatalTerminal) surviving into the next execution when the cached compile was reused — data and End signals were silently rejected by the done edge, leaving merge receivers waiting forever.

Fix: instead of recompiling on every execution (the band-aid from #25562), reset the pipeline edge terminal state so the cached compile can safely be reused:

  1. Add PipelineEdge.ResetTerminalStateForReuse() that drains buffered stale signals and clears the terminal state while preserving the channel buffer and NilBatchCnt.
  2. Call ResetTerminalStateForReuse on all MergeReceivers in Scope.resetForReuse, which runs via Compile.Reset on the prepared compile reuse path.
  3. Restore the original schema-change-only recompilation in initExecuteStmtParam (revert the always-recompile logic from fix(frontend): force recompile on each prepared execute to prevent hang #25562).

Verification:

  • Issue [Bug]: Protocol-level prepared UPDATE JOIN hangs on second execution #25526 reproducer (binary protocol prepared UPDATE...JOIN): both executions complete with correct updated rows (no hang).
  • TestIssue25526PreparedUpdateJoinSecondExecute (embedded cluster): PASS
  • mo-tester prepare/ BVT: 1021/1021 pass (100%)
  • PipelineEdge + Scope + frontend UT all pass (incl. -race)
  • git diff --check + make static-check: 0 issues

🤖 Generated with Claude Code

@ck89119
ck89119 requested review from XuPeng-SH and aunjgr as code owners July 11, 2026 10:29
@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 →

@mergify mergify Bot added the kind/bug Something isn't working label Jul 11, 2026
@matrix-meow matrix-meow added the size/M Denotes a PR that changes [100,499] lines label Jul 11, 2026
@ck89119
ck89119 force-pushed the issue-25614-main branch from 954a3d0 to d75859e Compare July 11, 2026 10:37
@mergify

mergify Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

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

This pull request spent 14 seconds in the queue, including 2 seconds running CI.

Required conditions to merge
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]
  • github-review-decision = APPROVED [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PESSIMISTIC)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PESSIMISTIC)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PESSIMISTIC)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
    • check-neutral = Matrixone Standlone CI / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
    • check-skipped = Matrixone Standlone CI / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-neutral = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
  • 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 Compose CI / multi cn e2e bvt test docker compose(Optimistic/PUSH)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(Optimistic/PUSH)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(Optimistic/PUSH)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
    • check-neutral = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
    • check-skipped = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Upgrade CI / Compatibility Test With Target on Linux/x64(LAUNCH)
    • check-neutral = Matrixone Upgrade CI / Compatibility Test With Target on Linux/x64(LAUNCH)
    • check-skipped = Matrixone Upgrade CI / Compatibility Test With Target on Linux/x64(LAUNCH)
  • 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 CI / SCA Test on Linux/arm64
    • check-neutral = Matrixone CI / SCA Test on Linux/arm64
    • check-skipped = Matrixone CI / SCA Test on Linux/arm64

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