Repository navigation
fix(vector): preserve CN labels for internal SQL - #28204
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.
Re-reviewed exact head fd40672 against its actual declared base 4.2-dev at 588295f (also merge-base). The 20-file change map remains the frontend statement snapshot -> background session -> process/remote codec -> vector/internal executor -> nested compile routing chain. Routing source, generated protobuf and tests are unchanged from the previous reviewed head apart from unrelated base-side compile lifecycle/database changes, so prior matching evidence is reusable. Read the production propagation and test changes again and checked that the generated payload/schema are unchanged from the prior review.
[P2: mandatory validation gap] Add the actual frontend-to-remote IVF routing regression
pkg/frontend/back_exec_test.go:163-251 still constructs a backSession, extracts its labels/intent and directly supplies both to PreviewQueryScheduling at line 222. The fake provider also supplies the already-filtered CN set. This bypasses doComQueryInBack, real generated IVF SQL, internal-executor option construction, remote encoding/decoding and execution candidate resolution. The complete changed-file list still adds no embedded/BVT integration scenario. Consequently this test does not fail when one of the production propagation edges responsible for #27966 is disconnected.
The prior requested proof remains required under the repository public multi-CN/pool-isolation test contract: start with a TP-labeled frontend statement, execute generated IVF work through the production background/internal/remote chain, assert the actual selected CNs stay in TP, and cover strict no-match failure plus query_max_workers inheritance. Do not inject the final SchedulingIntent directly into a scheduler preview. Reuse a minimal existing multi-CN fixture and publish exact-head selection and terminal evidence.
The known implementation defect is already fixed: complete scheduling intent is captured, child SQL does not widen it, and label maps are cloned at ownership boundaries. No new concrete implementation blocker is claimed. Q1/Q3 close through independent bounded metadata snapshots and normal session/process/compile ownership; this patch adds no new asynchronous worker or wait chain. Wire additions are additive and previously checked codec evidence remains applicable. Current generic green CI does not establish the missing composition scenario. No local native/cluster run performed.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Exact-head re-review: 00de364, current base 027194e. APPROVE: no confirmed blocker remains.
The current 21-file map covers frontend statement/background snapshots, internal executor options, remote process codec, vector SQL consumers, nested compile and integration evidence. Compared with our last reviewed fd40672 head, 17 in-scope files (including schema/generated protobuf) are unchanged and their evidence is reused; all new hunks in the remaining four files were read. I also re-traced the production routing chain. Immutable label clones and the complete statement-owned intent preserve pool strictness, worker cap and child-SQL ownership across the reviewed boundaries. The new parent-back-session walk closes the missing upstream sysvar lookup without replacing the already captured immutable statement policy.
The previous requested composition proof is now present: TestIssue27966FrontendIVFInternalSQLPreservesQueryPool starts a real four-CN fixture, sends the production proxy label preface to a frontend connection, verifies IVF selection, executes the public SQL and observes generated entries SQL at production placement. It checks exact query results, TP-only two-worker placement with a remote worker, then invalidates TP labels after outer admission and checks the generated internal query fails closed with no selected workers. This does not inject a prefiltered candidate set into PreviewQueryScheduling. Current CI run 34216932428 reports that named test PASS, 23.26 seconds (11:25:33–11:25:56 UTC); I did not run a local cluster.
The service-scoped observer copies value-only worker records, uses synchronized registration, and cleanup removes only its own entry; test collection is mutex-protected and fixture/query lifetimes are bounded. With no observer installed the production addition is a map lookup, not new I/O or asynchronous work. Existing codec/ownership evidence remains applicable, with no new wire delta in this revision. No demonstrated routing, concurrency, resource or unhappy-path defect was found. Head and applicable green CI were revalidated immediately before submission.
aunjgr
left a comment
There was a problem hiding this comment.
Reviewed exact head 00de364d7a9c191c417af23177c0b6ec1ebab9d4 against 4.2-dev at 027194e3ac2a41226059116ccb61d1432410edde. No confirmed merge-blocking finding remains.
I traced statement/background-session labels and scheduling intent through process serialization, executor options, nested compile, and vector-index batch/streaming/transaction SQL. Maps are independently cloned at ownership boundaries; the intent contains value-only fields. Parent strict-pool/worker-cap policy survives generated child SQL, while standalone background contexts stay separate.
The non-generated change map, schema/generated field mapping, NULL/default ownership controls, and real four-CN integration fixture were reviewed. Observer registration/removal is service-scoped and synchronized; callbacks receive independently owned worker records. No additional lifecycle or unbounded-state blocker was found.
Reused exact-head successful CI and the existing real frontend/proxy-label -> IVF internal SQL -> production placement evidence, including fail-closed pool loss. No local cluster was rerun. Head, open/non-draft state and passing applicable CI were rechecked before submission.
Merge Queue Status
This pull request spent 16 seconds in the queue, including 1 second running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #27966
What this PR does / why we need it:
Preserves the initiating statement's CN label selector across frontend background sessions, process snapshots, remote pipeline serialization, vector-index SQL execution, and nested internal SQL compilation.
This prevents internal IVF SQL generated by a TP-labeled query from losing its compute-pool constraint and being scheduled onto an AP CN.
The label maps are cloned at ownership boundaries so compile cleanup or caller mutation cannot alter the parent statement's routing constraint. Standalone background
SqlContextand auto-commit paths remain unconstrained.Tests cover frontend inheritance, executor option ownership, remote/two-hop process propagation, nested compile snapshots, and vector-index batch/streaming/transaction paths.