Repository navigation
fix: preserve string source provenance across execution - #27467
Conversation
# Conflicts: # pkg/defines/const.go
# Conflicts: # pkg/pb/pipeline/pipeline.pb.go
aunjgr
left a comment
There was a problem hiding this comment.
Re-reviewed exact head 0f6a420fbc8692162bc1a27db10b3632efaca849 against base ff4270c844c4b630cf1d921da813ba119d5b5e89 and the previously reviewed head d3d6a6d96651e54f0367a82dc538e70cafdd2ac7.
The prior merge-blocking hot-path regression is closed: metadata-free and uniform-source Union/UnionBatch now take O(1) provenance paths, mixed/override cases retain row-exact scans, and the no-metadata benchmark is back near the pre-feature range with zero allocations. I also rechecked the retained preflight/publication lifetimes and found no new confirmed ownership, cleanup, hang, or growth blocker.
Two coupled protocol/design blockers remain:
-
The only traceable design approval is for revision
148b1ad60ed01070b554d77b5fb41fda4d985672, whose compatibility contract assigned StringSource to MORPC v30 with a v29 fallback. The current artifact was materially changed by later conflict resolution to a v31/v32 contract and still saysProposed,Pending, and that implementation approval remains blocked. Obtain a distinct maintainer design approval for the exact current revision, then record implementation conformance against that revision. -
This head assigns MORPC v32 to independent StringSource transport, while open PR #27738 assigns the same v32 to cached-plan generation snapshots. These cannot be independent capabilities under one negotiated version: an intermediate v32 binary containing only one PR can be paired with a later v32 binary that assumes both capabilities, causing one side to send metadata the other v32 peer does not implement. Resolve the merge order/rebase so each independently deployable capability has an unambiguous version, then update the design, sender/receiver/process/group gates, and v(N-1)/vN controls consistently before the exact-revision design approval.
The implementation is otherwise materially improved; this request is specifically for the unresolved current wire contract and its required approval, not a re-raise of the fixed performance finding.
aunjgr
left a comment
There was a problem hiding this comment.
Correction to my preceding review on exact head 0f6a420fbc8692162bc1a27db10b3632efaca849: I withdraw the cross-PR MORPC v32 collision as a finding against #27467. Merge order owns conflict resolution; whichever PR lands second must rebase and assign the next unambiguous capability version. #27467 does not need to anticipate an unmerged PR.
The implementation and performance review otherwise passes. The sole remaining blocker is internal to this PR: its current design artifact materially changed from the approved revision 148b1ad60ed01070b554d77b5fb41fda4d985672 to the current v31/v32 compatibility contract, and the artifact itself remains Proposed with an explicit Pending approval record. Please obtain the required traceable maintainer design approval for the exact current revision and record implementation conformance against it.
|
@aunjgr Addressed the protocol-ordering blocker at exact head |
iamlinjunhong
left a comment
There was a problem hiding this comment.
Reviewed exact head de34f445a42214eb2e25baeb03a76b48f5c8c2e9 against merge-base 662c1bd63e8be02e3685e2695f002704c9781708, and checked integration with current origin/main at 32053f54a955cf1db89ff5943de32cc0f3931353.
No confirmed P0/P1 blockers. The exact v31/v32 capability ordering, sender/result/process/group-state gates, source-free fast paths, vector/batch publication, group/aggregate preflight lifetime, planner folding, and reset/reuse paths are internally consistent. One P2 decode-validation gap remains; it is recorded inline.
Validation evidence: all 26 GitHub checks are completed with no failing or pending check; git diff --check is clean; a merge-tree with current origin/main is clean. Local focused tests could not start because this isolated worktree lacks cgo/libmo.dylib and jemalloc.h, so I did not treat those environment failures as code results.
Decision: COMMENT (first review, P2 only).
# Conflicts: # pkg/defines/const.go # pkg/pb/pipeline/pipeline.pb.go
# Conflicts: # pkg/frontend/computation_wrapper.go
aunjgr
left a comment
There was a problem hiding this comment.
Re-reviewed exact head 3a422fee0a0f98665f5a2785e6e2b24dc1830398 against merge base 8b0a5ff873824737e2c89c19876460a3073de40d and current main.
The previously fixed publication lifetimes, source-free fast path, malformed process-metadata validation, and implementation ownership model remain sound. Two coupled current-revision blockers remain:
-
The exact design artifact still declares itself
Proposed, records approval asPending, and explicitly blocks implementation approval. Its compatibility contract assigns StringSource transport to v33. Obtain a traceable maintainer design approval for the final post-merge revision, then record implementation conformance against that exact revision. -
Merged main now owns v33 for stable string-shuffle hashing and v34 for persisted unsigned metadata, while this head independently assigns StringSource to v33. A peer advertising main's v33 does not implement the StringSource trailer/process/group-state contract. Because this PR is now the later capability, merge current main, allocate the next unique cumulative generation, and update the design, sender/receiver/process/group gates, generated protobuf evidence, and v(N-1)/vN controls consistently before design approval.
I found no new blocking lifecycle, cleanup, boundedness, or hot-path issue beyond this stale wire/design contract. Exact-head CI is fully green.
# Conflicts: # pkg/defines/const.go # pkg/frontend/computation_wrapper_test.go # pkg/pb/pipeline/pipeline.pb.go # pkg/pb/plan/plan.pb.go
aunjgr
left a comment
There was a problem hiding this comment.
Re-reviewed exact head bbbf523e630c351964a7d83d01cc999b6eb9a8e3 against merge base 9c9223ba7feec745bd23efba656bcfdfaca947fd and newest main@02af906c367b3ef7e530336651ba033f8c14861c. The prior v33 collision was correctly resolved and this head is internally consistent at v35, but two coupled blockers remain.
-
Newest main now owns MORPC v35 for scaled variance state with exact numeric origins (
02af906c36). This head independently assigns v35 to StringSource batch/process/group-state transport. A v35 peer containing only main’s capability does not implement this PR’s trailer and metadata contract, so the same advertised generation again denotes different independently deployable feature sets. This is not a merge-order objection: #27467 is now the later change and must merge current main, allocate v36, and update every sender/receiver/process/group gate, compatibility control, constant, generated artifact, and design reference consistently. -
The exact design artifact still declares
Proposed, records approval asPending, and explicitly blocks implementation approval. Its compatibility section is materially tied to v34/v35. After rebasing and finalizing the v35/v36 matrix, obtain a traceable maintainer design approval for that exact revision and record implementation conformance against it.
The previously reviewed provenance semantics, pre-publication reservation lifetimes, decoder validation, and source-free/uniform fast paths remain sound. The textual merge conflict itself is not my blocker; the ambiguous cumulative wire generation and still-unapproved final design are.
# Conflicts: # pkg/defines/const.go
aunjgr
left a comment
There was a problem hiding this comment.
Re-reviewed exact head e3d1abb47723fa5f8c63ac2a229d7c6706abbe35 against merge base 02af906c367b3ef7e530336651ba033f8c14861c and newest main@b7892451b3d3df7ca998d45a215d07b20c415ecb.
The prior wire-generation blocker is closed. Main owns v35 for scaled variance state, this head assigns StringSource to v36, the sender/receiver/process/group-state controls and v35-negative/v36-positive tests are aligned, and newest main adds no competing protocol generation. The previously reviewed provenance semantics, publication lifetimes, decoder validation, and source-free/uniform fast paths remain sound.
The sole remaining blocker is the exact current design gate. docs/design/CLAUDE_STRING_SOURCE_PROVENANCE_DESIGN.md still declares Proposed, records the approval as Pending, and explicitly says implementation approval remains blocked. Its now-final compatibility contract is materially v35/v36, whereas the only traceable design approval covers the earlier v29/v30 revision. Obtain a distinct maintainer design approval for this exact v35/v36 revision, record the approval and implementation conformance against it, and update the PR body’s stale statement that the feature uses MORPC v29—the exact implementation uses v36.
I found no additional blocking correctness, lifecycle, compatibility, boundedness, or performance issue on this head.
# Conflicts: # pkg/pb/plan/plan.pb.go
# Conflicts: # pkg/pb/plan/plan.pb.go
# Conflicts: # pkg/defines/const.go # pkg/frontend/computation_wrapper.go # pkg/sql/colexec/evalExpression.go
XuPeng-SH
left a comment
There was a problem hiding this comment.
Independent design revalidation PASS for exact revision 2bb81b05eeee7da0b2afe863d3e3e6a5c21e5477.
The previously approved independent StringSource axis, scalar/on-demand sidecar representation, selected/merge semantics, pre-publication allocation ownership, v36 downgrade, no-catalog rollback, and source-free performance budget remain coherent. The post-approval design delta advances the capability to v37 because main now owns v36 for prepared JSON comparison, and validates malformed process metadata before transaction/process allocation. Current main still ends at v36; among the live reviewed branches, this PR established its v37 allocation first (398ed49dd2b83675d8eed2b06bbc3fdfc7125995). The other live v37 claimants have been marked for rebase/fresh allocation, so this review treats #27467 as the merge-first v37 owner.
Decision: PASS. Implementation review remains separate.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep implementation re-review completed at exact head 2bb81b05eeee7da0b2afe863d3e3e6a5c21e5477 against the separately revalidated design.
Range-diff confirms that the previously approved 20-commit implementation series is patch-identical; the only feature-side production delta validates StringSource metadata before NewWithSnapshot, so malformed length/enum input fails before transaction/process ownership begins. The later remote-expression edit only relaxes a test from exact latest-version equality to the correct cumulative >= v36 invariant after the new capability.
I rechecked the high-risk surfaces: vector/batch/group/aggregate source ownership, commit-before-allocation ordering, decode rollback, cancel/reset/free paths, v36 downgrade/v37 transport fencing at process/batch/group/remote-result boundaries, unknown enum/length handling, mixed-const rejection, and current-main integration. The merge tree with current main is clean. Exact-head focused process-codec tests pass.
Performance was reproduced on Apple M4 with five 500 ms samples of BenchmarkUnionBatchNoMetadata: 119.0–122.6 ns/op, 0 B/op, 0 allocs/op, retaining the approved source-free fast-path budget. No blocking correctness, lifecycle, compatibility, capacity, or performance issue remains. Merge this v37 owner before the other currently blocked v37 claimants.
Merge Queue Status
This pull request spent 49 minutes 35 seconds in the queue, including 49 minutes 16 seconds running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #27215
What this PR does / why we need it:
mo/main, preserves its runtime specialization behavior, and layers SQLPrepare/COMStmt StringSource ownership without weakening cached-plan semanticsTesting
[Literal, UserVariable, Literal]group allocation rejection before hash publication and no-allocation-after-commit controlsgo list,go build,go vet, owning-package unit tests, BVT verification,gofmt, andgit diff --checkReview round 8
mo/mainatba8954d543; resolvedplan.proto/pipeline.protoadditively and regenerated both.pb.gofiles withmake generate-pbhashmap.UnitLimit-bounded operator-owned preview scratch and selected-row source overrides[Literal, Expression], including a shared GROUP BY / ANY_VALUE columnReview round 9
hashmap.UnitLimit-bounded touched destination vectors; success and every error path finalize through a pre-commit-installed defera/Literalthena/Expression + b/Literalin internal commit and full operator paths; an allocation controller rejects only afterHash.GroupCount()==2and observes no allocationmo/mainat53f6aa6f0bReview round 10
errors.IsthroughUnwrap; post-publication failures remain non-retryablecancelGroupByPreflightsand the existing spill/retry loop in Group, MergeGroup, and spill reloada/Literalthena/Expression, one rejection at resident group count 1, successful spill/retry, final source Expression and count 2mo/mainat6a8e7ecc53Conflict resolution round 11
mo/mainat22b91fe986pipeline.pb.go/plan.pb.gowithmake generate-pb; repeated generation is cleanReview round 12
PreExtendnow admits mixedstringSourcesalongside every other row-parallel sidecar; successful pre-extension makes laterSetLengthallocation-freeT_anyNULL partition materializer preserves selected SQLPrepare/COMStmt ownership for constant and selected NULLsmo/mainatae12701a88; BVT remains 33/33Review round 13
Review round 14
mo/mainate866c535f5; build, vet, UT, SCA, make, and string-source BVT (33/33) passReview round 15
mo/main(e866c535f5)CI/conflict update
mo/mainat8dd1efc201TestCloneCommitFailureRollbackKeepsSourceFilesduring logservice/Hakeeper connection reset with concurrent Dragonboat heartbeat/propose timeouts; the exact test passes locally after the merge (21.77s)Review follow-up: publication and NULL ownership
UnionOne,UnionMulti,Union,UnionBatch, andGetUnionAllFunction) and finalized them on every exitColumnExpressionExecutorcache creation and reusemo/mainatc3974615c9; owning/dependent build, vet, UT, SCA, make, and StringSource BVT (33/33) passHot-path review follow-up
BenchmarkUnionBatchNoMetadataimproved from the pre-fix 5.700–5.821 µs/op to a stable 159.0–187.5 ns/op range (0 B/op, 0 allocs/op); uniform scalar measured 164.6–221.3 ns/opmo/mainat5bc051abc4; owning/dependent UT, build, vet, SCA, make, and StringSource BVT (33/33) passDesign-gate phase
A stable architecture record is now available at
docs/design/CLAUDE_STRING_SOURCE_PROVENANCE_DESIGN.md, revision148b1ad60e.It links issue #27215 and this implementation PR and defines:
The document is intentionally marked Proposed. The earlier v30 design revision was approved, but the current v36/v37 compatibility revision still requires a distinct, traceable maintainer design approval; no approval is being inferred or self-recorded here.
Current MORPC capability ordering
mo/mainat1a4f656bb2, which now includes PR fix(txn): preserve cached plan generation across transactions #27738make pb; generated files were not hand-editedThe current proposed design revision is
398ed49dd2. Distinct maintainer design approval and implementation conformance remain required for this exact revision.