Skip to content

fix(stage): return an error for missing catalog context - #32741

Merged
XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/main-stage-catalog-context
Nov 14, 2026
Merged

XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/main-stage-catalog-context

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:

Related to #18534.

What this PR does / why we need it:

Main already supports host- and path-form Stage URIs, but resolving either through a Datalink with no process panics in StageLoadCatalog. For example, ParseDatalink("stage:///a/b/c/1.txt?size=c", nil) reaches the Stage cache before validating the range.

Return an internal error when the process, its base, or its Stage cache is missing. This propagates through Datalink, export, and nested Stage resolution without returning a partial result. Initialized callers retain the existing Stage resolution, access checks, and range validation. The ordinary SQL process initialization path is unchanged; this PR does not claim a normal SQL statement alone produces a nil process.

Clarify the existing Stage URI syntax and the 4.2.8 server compatibility boundary in the SDK guide. The companion 4.2 change is in #32723.

Validation

  • Before the fix, the focused regression on main 5540b068209c reproduced the nil pointer panic in StageLoadCatalog.
  • Linux/amd64, Go 1.27.1, CPU: complete pkg/datalink and pkg/stage/stageutil tests passed with coverage; the regressions cover three missing-context states, both URI forms, five Datalink entry points, export and nested Stage. Existing valid Stage and malformed-range controls pass.
  • Scoped go vet and incremental golangci-lint passed for the changed packages. Main SDK URI helper examples for spaces, encoded slashes, literal percent sequences and host-form names passed.

@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 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@XuPeng-SH

XuPeng-SH commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · done

Commit: d456b5b5b41f67ed611f5e9adc6a7fc42787e8d3

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

mo-bot review · mo-bot-local · review

Commit: d456b5b5b41f67ed611f5e9adc6a7fc42787e8d3

Assessment: approve

The guard handles missing process, base and Stage cache at the existing catalog owner, preserving initialized resolution and error propagation. The URI documentation matches the SDK and frozen 4.2.8 parser.

Model: gpt-6.1-sol / max

Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0

Validation:

  • Reviewed the complete four-file delta, affected callers, existing controls, linked issue and all discussion entries. Saved the review plan and discussion assessment; source remains unchanged.

  • Reused exact-head successful server-build CI, eight Python offline matrix jobs and two core-import jobs. Verified the documented release boundary against frozen tag v4.2.8.

  • Isolation preflight, git diff --check and native prerequisite builds passed. Receipts and retained logs are reconciled in validation-manifest.json.

Limitations:

  • Local Go tests and vet were not executed: installed Go 1.26.6 is below the required 1.27.1, and toolchain bootstrap timed out after 180 seconds. This is an environment limitation, not a test result.

  • Author-reported Go package passes lack retained local artifacts; Go UT, coverage and SCA remained pending in the supplied CI snapshot.

This branch was successfully deployed

No deployments
ci — 56e1b8f5 Deployed Nov 14, 2026 by XuPeng-SH
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 kind/documentation Improvements or additions to documentation kind/test-ci size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants