Skip to content

[4.2] fix(cnservice): bound stale pipeline backend retries - #27555

Merged
XuPeng-SH merged 1 commit into
matrixorigin:4.2-devfrom
XuPeng-SH:backport/27528-4.2
Aug 24, 2026
Merged

XuPeng-SH merged 1 commit into
matrixorigin:4.2-devfrom
XuPeng-SH:backport/27528-4.2

Conversation

@XuPeng-SH

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:

Backport of #27528 for 4.2-dev.

Related issue: #27523.

What this PR does / why we need it:

  • Bounds Pipeline asynchronous backend-creation queue admission by the configured per-connect timeout.
  • Bounds the subsequent connect/retry phase by the same timeout, so a stale scheduled CN route cannot inherit a potentially day-long SQL context.
  • Keeps the scheduled CN endpoint fixed: recovery establishes that route within budget or fails the statement; it does not silently redirect work to another CN.
  • Adds a regression using the retryable RPC-timeout error produced by the backend connect loop.

The backport patch-id is identical to the final two-file diff of #27528.

Validation

  • GOWORK=off go list -mod=readonly ./pkg/cnservice/cnclient
  • GOWORK=off go build -mod=readonly ./pkg/cnservice/cnclient
  • GOWORK=off go vet -mod=readonly ./pkg/cnservice/cnclient
  • focused TestPipelineBackendCreateOptionsBoundRetry
  • full ./pkg/cnservice/cnclient tests
  • focused race stress: TestPipelineBackendCreateOptionsBoundRetry, -race -count=100
  • full ./pkg/cnservice/cnclient race test
  • full ./pkg/common/morpc tests
  • full ./pkg/sql/compile tests
  • 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 →

@LeftHandCold LeftHandCold left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed exact head 32bdbf5 against PR base and merge-base 4.2-dev@399e1a16ad048b4b968d125fcdc9c96beb21ed6a.

No blockers. The net two-file diff has the same stable patch-id as the approved final diff of #27528. Pipeline backend creation now bounds both process-wide factory queue admission and the connect/retry phase with the 5-second per-connect budget. The scheduled endpoint remains fixed; failure propagates to RemoteRun, which cancels and cleans the statement path. Q1-Q3 close: no new resource owner or unbounded accumulation, every wait reaches a local timeout/context edge, and existing MORPC generation checks prevent late factory completion from publishing into a replaced generation.

Validated the changed package with go list, build, vet, focused regression, full tests, focused race stress at count=100 using T=0.04s and B=30s, full owning-package race, full MORPC tests, compile failure/cleanup consumer tests, and diff checks. The full compile package has three unrelated Parquet fanout failures; the exact base reproduces the same three tests with identical assertions under the same toolchain and native artifacts. CI was still running at review time.

@mergify

mergify Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

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

  • Queue this pull request

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.

3 participants