Repository navigation
feat: bind embedded Sirius MO reads - #29209
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed exact head 170c4df against main 510e28e.\n\nThe pure binding implementation and focused positive/negative tests are substantially coherent, and the existing Flight extension-table Build path remains isolated.\n\nRequesting changes for the design-first delivery gate: this PR crosses planner/Substrait and the embedded MO/TAE ABI boundary, so it must link the exact reviewed revision of docs/design/sirius-embedded.md and record the implementation alignment/approval before this implementation-boundary PR can be approved. The current body references #28966 but does not identify the design revision or approval record.\n\nPlease add that exact design revision/link and explicitly map the binding ID/source/schema and failure contracts here to the approved design. No production enablement or coverage-percentage issue is being raised.
|
@XuPeng-SH Addressed the design-first delivery request in the PR body: it now links the exact reviewed design v2 revision ( |
aptend
left a comment
There was a problem hiding this comment.
Deep-reviewed exact head 170c4df against base 510e28e, including all review history and the now-linked embedded-design v2 revision 24161f6. The earlier design-first delivery gap is closed in the PR body without a code/head change. I checked binding identity/order/replay rejection, MO post-scan versus direct-TAE schema semantics, filter/project/fetch ownership, physical column provenance, deterministic wire output, legacy Flight isolation, and the focused negative tests. Exact-head required CI and the owning package tests are green. No blocking correctness issue found; later reader/native PRs still own snapshot/account scoping, lifecycle, bounded buffers, and public GPU evidence as recorded by the design.
|
@XuPeng-SH Your review correctly separated the hidden-suffix code fix from the design-first gate. The former is fixed at Please perform and record an independent technical review of the current MO-reader-only |
|
@fengttt Thank you for approving #29209 at |
|
@XuPeng-SH Follow-up on the exact-revision design gate for #29209: the head remains d6e95dd and its MO-reader-only design blob is 331110571c8ad735f897940aa8eb694d8170bb5e. The hidden-column binding defect was fixed at this head and required CI is green. Sirius #22 and MO #29254 have now merged; the native bridge is validated locally against those inputs but remains draft/unpushed until this design gate closes. Could you record an independent technical approval or a concrete remaining design blocker for this v2 blob? I am not treating the earlier v1 approval or an empty implementation approval as that decision. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
APPROVE — reviewed exact head d6e95dddbd2ad559a3ac08e696030ce9fae27cfb against declared base/merge-base 16d8e5106caaedfe0a7296e4f628683e1b6a92b4. Fresh main checked: 087000434fedf24aaa7f0b2192c34c2aaaf3a9e8. Read all four changed files/hunks and all PR comments/reviews. No subagents. No blocking finding remains in this PR's pure plan-binding scope.
Phase 1: independent technical design decision
I explicitly approve design version 2, blob 331110571c8ad735f897940aa8eb694d8170bb5e, at this head, before the implementation decision below. This closes my earlier exact-revision design-review request; it does not rely on an empty implementation approval or reinterpret the earlier v1 decision.
The MO-reader-only narrowing is technically sound: MO remains the owner of authorization, statement snapshot, relation handles, scan filtering/projection/fetch and result publication. The milestone does not introduce another TAE snapshot/lease/storage authority. Query-local native bindings are preferable to an in-process reimplementation of Flight's resolver or storage admission.
The design compares Flight, eager FFI and Arrow-at-both-boundaries alternatives, separates transport bounds from algorithm state, specifies finite admission/input/output budgets, and requires independent cancellation followed by quiescence before release/reuse. Fatal native failure deliberately fails the MO process closed instead of pretending timeout makes live native memory safe to free. Flight compatibility/recovery remains necessary during coexistence; deleting it in this preparatory PR would be premature. MO-reader performance is compared to controlled Flight+MO, while Flight+TAE remains context rather than a mismatched acceptance baseline. GPU correctness, numeric compatibility, all-22 performance and removal remain explicit downstream cutover gates, not claims delivered here.
Phase 2: implementation and adversarial checks
| Closure | Verification |
|---|---|
| Binding identity / native consumer | Deterministic read order and IDs, exact binding count, absent/zero/duplicate/swapped IDs, unsupported source and replay rejection. Cross-checked Sirius native plan validator blob 3dc4de8b47d0018b4adde7a464df60f66ab65236: the named-table prefix, canonical positive ID, single occurrence, schema names/types/nullability and backward reference contracts align. This was source inspection, not a linked native run. |
| Post-scan schema / execution owner | Direct projection preserves order, duplicate column occurrences, physical ID/sequence and declared output types; computed/type-mismatched/hidden-column shapes reject. Traced MO's TABLE_SCAN compile path: filter/projection then offset/limit are already applied, so replacing the complete scan avoids applying them twice. Operators above the scan remain in the Substrait tree. |
| Adjacent controls / legacy path | Hidden suffix with empty projection rejects; no-hidden empty projection succeeds. Shared physical scan occurrences reject, while a SINK producer referenced by later SINK_SCAN steps is not a second physical occurrence. Existing Flight Build retains extension-table reads and filter/project/fetch wrappers. These source traces supplement, not masquerade as, freshly executed SQL. |
| Q1 ownership | New maps/slices/protobufs are invocation-local GC-managed plan data. No reader, lease, native handle or asynchronous owner is created here. Failures publish no wire plan and do not mutate candidate state. |
| Q2 waits / reuse | No new blocking I/O, lock, goroutine or cancellation state machine. A failed binding attempt leaves no retained exporter state for a later call. Native wait/teardown obligations remain with the explicitly identified downstream execution owner. |
| Q3 / cost | Metadata work scales with the input plan/schema; existing final wire-size check is retained. This PR adds preparation work, not row/batch buffering or a per-row execution cost. No GPU speedup claim is established by it. |
Historical review closure: the hidden-suffix defect is repaired at this exact head with TestEmbeddedMOReadRejectsHiddenSuffixWithoutProjection and its nearest no-hidden control. The earlier missing-link/exact-v2-design decision is closed by the current PR link and the explicit phase-1 approval above. I found no other outstanding actionable request in the fetched review/comment history.
Increment quality and non-blocking simplification
Reviewed separately: implementation +323/-8, tests +241/-0, design +36/-32.
- The tests use small pure fixtures and assert decoded wire/schema and explicit rejection, including preservation of Flight behavior. No new cluster, sleeps or heavy setup. For this not-yet-connected internal builder, SQL/GPU BVT belongs to the real integration PR; it is not evidence required to pretend this helper already enables offload.
- There is still avoidable preparation duplication:
BuildEmbeddedrepeats Build's relation/root/version/marshal/size assembly; binding validation and construction recomputeembeddedMORead;exporter.readcomputes physical schema bytes/column mappings that the embedded branch discards. Prefer a small shared serializer and avoiding discarded computations while preserving structural validation. Likewise, preflight occurrence validation andembeddedReadSeenoverlap. These are bounded maintainability/cost opportunities, not demonstrated correctness or material runtime regressions; no generic framework/cache is warranted. - The revised document removes the direct-TAE route consistently while preserving still-live Flight ownership. The tracking issue body still contains old direct-TAE goals; update its current-scope summary for consistency rather than adding another design document. The owner scope comment and versioned v2 document make the current decision unambiguous.
Evidence and limits
Reused successful exact-head CI run 35837768478, including UT, SCA and existing BVT checks. Downloaded its final-result-files artifact and inspected merged_coverage.out: the new binding code, hidden-column rejection/control, duplicate/replay rejection and projection-error branches have execution hits. This verifies selection, not adequacy by coverage percentage. Author reports focused/full substrait package tests and vet at this head; no fresh local pass is claimed.
git diff --check passed. A local focused test attempt through the prescribed CGo wrapper stopped before test execution: this linked worktree lacks libmo and native-input provenance differs from the primary worktree. I did not bypass provenance or relabel that as a test failure/pass. No product files were changed. Main's later shared-exporter EXTRACT changes were inspected separately; this decision is for the exact PR head, not an untested rebased binary.
Approval is for this plan-binding increment and the identified design revision only, not native bridge delivery, GPU performance acceptance, production cutover or closure of #28966.
Merge Queue Status
This pull request spent 10 minutes 30 seconds in the queue, with no time running CI. ReasonPull request #29209 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.
HintYou 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. Waiting for any of
All conditions
Tick the box to put this pull request back in the merge queue (same as
|
What type of PR is this?
Which issue(s) this PR fixes:
Refs #28966. This PR does not close the migration issue.
Review notes
The owner narrowed this migration milestone to MO-reader input on 2026-09-23. Direct-TAE reads and new TAE/lock changes are deferred; #29255 was closed.
The MO-reader-only embedded design v2 supersedes the unmerged direct-TAE draft for this milestone. Sections 3 and 4 define MO-owned input and bindings; sections 6 and 7 retain fail-closed execution and Flight compatibility; section 10 requires all 22 queries on embedded MO-reader input with two streams. Independent technical review of this exact revised design blob has been requested; prior approval of v1 is not being treated as v2 approval.
Focused embedded binding tests, the full
pkg/sql/plan/substraitpackage,go vet, formatting, and diff checks passed locally. Exact-head CI has no failed or pending checks.What this PR does / why we need it:
Add deterministic, query-local MO read bindings to embedded Sirius Substrait plans. Each binding advertises the exact post-scan schema emitted by its MO producer. Reject invalid sources, binding identities, projections, and hidden-column shapes before native preparation; preserve the existing Flight plan path.