Repository navigation
Conversation
Treat scalar PRE membership as a required search domain and reuse broadcast HashBuild streams to seal the same exact domain on every vector-scan CN. Gate distributed placement for mixed-version and unsupported execution shapes while preserving fail-closed local fallback semantics. Restore per-CN DOP with disjoint combined shard identities, reader-owned child contexts, and one synchronized snapshot clone per local reader generation. Share centroid cache and serialized membership state without sharing mutable reader state. Apply membership before bounded local Top-K admission so nearer nonmembers cannot under-fill results, and strengthen the matrixorigin#27854 distributed BVT with adversarial distractors.
…flat-search-domain-27854
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.
Request changes on exact head 100959ea6522.
-
[P1] Preserve reader cardinality for an empty required domain.
RuntimeFilter_DROPis correctly interpreted as an exact empty domain, butbuildReadersreturns exactly oneEmptyReaderatpkg/sql/compile/scope.go:1687-1690. The new vector path setsMcpu > 1;buildScanParallelRunthen createsMcpuscopes and indexesreaders[i]. A PRE predicate matching zero rows therefore reaches an index-out-of-range panic instead of returning an empty result. Return one empty reader per effectiveMcpuand add a test that drives the DROP terminal through the parallel-scan construction path withMcpu > 1. -
[P1] Do not reuse cumulative MORPC version 43. This head declares
MORPCVersion43for the new required-domain plan field, while open #27553 already declares version 43 for the MongoDB explicit-query payload (889d92833751); the latest #27756 head also records 43 as reserved by #27553 and moves its own gate to 44. Sharing the same rollout gate means a deployment can advertise version 43 while a receiver understands only one of the two independent wire additions. Rebase the current integration state and allocate a unique next version, with below/at-gate compatibility coverage. -
[P2] Close the distributed design and performance acceptance gate. This changes a wire contract, cross-CN placement, and reader concurrency, but the same-PR design is already marked
implementedwithout an approved design phase. Its own acceptance requires 1-CN versus multi-CN result equivalence and evidence that DOP reduces the entries-scan critical path without recall loss. The added BVT has only 124 rows and does not force or observe multi-CN × multi-reader execution; no #27854-scale before/after data is provided. This matters because membership now disables storage Top-K and creates per-reader lookup state, so green functional CI cannot establish the latency/CPU/memory tradeoff. Please provide a deterministic topology test (including empty domain) and representative 1-CN/3-CN+DOP measurements for QPS/latency, CPU, peak query memory or membership-state amplification, scanned vectors/bytes, and recall, then update the design with the accepted decision and evidence.
…flat-search-domain-27854 # Conflicts: # pkg/vectorindex/ivfflat/plan_reader.go
Preserve parallel reader cardinality for exact empty domains and keep adaptive searches on one reader when they own a mutable cursor. Build one admitted exact integer membership filter, metadata version, and centroid route per CN search generation. Share them across disjoint readers while storage intersects membership before distance-range and Top-K admission; retain the exact local fallback for unsupported domains. Add forced multi-CN empty/result equivalence, ownership and race coverage, and persisted 768-dimensional benchmark evidence for the bounded storage path.
…flat-search-domain-27854 # Conflicts: # pkg/defines/const.go # pkg/pb/plan/plan.pb.go # pkg/sql/plan/deepcopy.go # pkg/sql/plan/deepcopy_test.go # proto/plan.proto
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep re-review of exact head 7ac289d2b6f002614ed1b2bdf14367e6d9a47861 against PR base 4f90107c8c486369b58cda81837ded520d86c21a and the previously reviewed coordinator-local head 09c15e8a205566d38b2b900b632ea7a10a07be3a.
The implementation blockers from the earlier heads remain closed. I rechecked required-domain terminal handling, source-PK typing, coordinator placement, local DOP and disjoint shards, shared filter/snapshot/centroid ownership, partial-open cleanup, cancellation, filter-before-storage-Top-K ordering, bounded candidate output, and final SQL recheck. I found no new deterministic correctness, lifecycle, hang, or unbounded-growth defect. The production path is unchanged by the latest evidence commit; the synthetic merge with latest main is clean, and exact-head UT, SCA, coverage, proxy BVT, and pessimistic multi-CN BVT are green.
[P1] The new reduced benchmark still does not establish that this PR fixes #27854 at the workload dimension where the regression occurs.
The issue is 10M rows, 768 dimensions, 3 CNs, 3,162 lists, and 100 concurrent clients. It has reproduced at about 0.37 QPS with timeouts and more recently at 15.76/49.55 QPS versus roughly 70-80 QPS controls. The new endpoint fixture uses 1,024 rows, 8 lists, and an exact domain of only 128 rows. More importantly, every one of its 100 pinned connections uses the address from GetCNService(0), so the two other started CNs do not carry query traffic. This removes the persisted-object/range/domain amplification and aggregate multi-coordinator pressure that make the issue reachable.
The reported endpoint delta is only 7,018 to 7,222 QPS (about +2.9%), while p95 changes from 13.69 ms to 14.48 ms; that is consistent with a useful small-fixture smoke test, not evidence that a 33-79% or 440x issue-scale regression is removed. The 8,192-row storage benchmark usefully proves the storage primitive avoids returning selected embeddings, but it injects selectRows directly into three independent LocalFS fixtures. It bypasses the PRE HashBuild/runtime-filter path, planner placement, local-DOP range construction, candidate merge/final recheck, and query-level CPU/memory pressure, so it cannot substitute for endpoint evidence.
Please run exact main versus this exact head on the existing Wiki-10M deployment with 3-CN/proxy distribution and 100 concurrency. A reduced query count is sufficient; the full 10,000-query pass is unnecessary. Report QPS and p50/p95/p99, recall, CN CPU/peak query memory, and scanned vectors/bytes. Alternatively, demonstrate that a reduced fixture preserves and correlates the relevant persisted-object count, exact-domain cardinality, range/candidate amplification, and coordinator distribution before using it as the acceptance proxy. This is needed to show that the performance bug is actually fixed without moving the bottleneck or introducing a resource regression.
[P2] Align the protobuf contract comment with the implemented placement. proto/plan.proto still says every CN owning a VECTOR_INDEX_SCAN shard builds the domain from its local broadcast stream, while the accepted implementation and design require one coordinator-local domain and no cross-CN domain protocol. Please update the comment so future compatibility work does not infer a distributed contract that this PR deliberately removed.
7ac289d to
09c15e8
Compare
There was a problem hiding this comment.
Deep re-review of exact head 136dffc against current main 109bf92.
The implementation-side correctness and lifecycle fixes remain coherent: the required domain is coordinator-local; DROP preserves reader cardinality; local readers use disjoint shard identities and child contexts; exact integer membership is shared and applied before storage Top-K; partial construction and filter shares have cleanup; and there is no cross-CN MORPC capability claim. Exact-head CI is green.
Two blockers from the previous review remain on this head:
[P1] Supply representative evidence that this performance PR fixes #27854 at the workload where it fails.
The reported incident is Wiki-10M, 768 dimensions, 3 CNs, 3,162 lists, and 100 concurrent clients. The current branch retains only the 8,192-row storage-boundary microbenchmark. The latest merge actually removes BenchmarkIssue27854CoordinatorLocalEndpoint and its reduced endpoint results. The remaining benchmark bypasses PRE HashBuild/runtime-filter delivery, planner placement, local-DOP range construction, candidate merge/final recheck, and concurrent query-level CPU/memory pressure. It proves the storage primitive avoids embedding materialization, but cannot establish that the observed endpoint QPS/timeout regression is removed or merely moved.
Please run exact main versus this exact coordinator-local head on the existing Wiki-10M 3-CN/proxy deployment at 100 concurrency, with a reduced query count if needed. Report QPS, p50/p95/p99, recall, CN CPU/peak query memory, and scanned vectors/bytes. An equivalent reduced fixture is acceptable only if it reproduces and correlates the relevant persisted-object count, exact-domain cardinality, candidate/range amplification, and coordinator traffic.
[P2] Correct the protobuf contract comment.
proto/plan.proto still says every CN owning a VECTOR_INDEX_SCAN shard builds the required domain from a complete local broadcast stream. The implementation and design deliberately force this scan to one coordinator and never serialize the domain to another CN. Update the comment and regenerate plan.pb.go so the wire contract describes the implemented coordinator-local invariant.
I also rechecked the current 25-file diff after the latest main merge. I found no additional deterministic correctness, hang, ownership, or unbounded-growth blocker beyond the missing issue-scale performance proof and the contradictory contract documentation.
aptend
left a comment
There was a problem hiding this comment.
Deep re-review of the exact current head. The four feature commits are unchanged from the previously reviewed head; this pass also checked the complete diff, all review threads and author replies, the linked severity/s-1 workload, and the latest main integration. Correctness and lifecycle tests pass, but the performance-fix acceptance gap below remains blocking. The protobuf comment should also be corrected before merge.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep re-review of exact head cd8d0ebb8a14b817636841e1f564fc20da19aaba against base 3d67664696e48cec0efc84308fb7de1cfda2f7db. No concrete remaining blocker found for the coordinator-local implementation.
The current design deliberately restores the domain-before-search phase and local reader DOP, not a distributed domain protocol. I accept that bounded scope: required PRE scans remain coordinator-local, the full scalar predicate is rechecked, and exact membership precedes storage Top-K so nearer nonmembers cannot consume the candidate budget. The protobuf contract comment now agrees with that placement; the previous v43/v44 allocation objections do not apply because this revision claims no new cross-CN capability.
I rechecked the DROP reader-cardinality terminal; invalid/PASS required-domain rejection; local shard identity and overflow checks; single-reader correlated/adaptive paths; shared exact-filter, version, centroid route and snapshot ownership; reader child cancellation; partial-construction reference balancing; and filter-share cleanup before and after storage-reader construction. The plugin hook and both compiler/APPLY callers agree on reader cardinality. No demonstrated new correctness, hang, double cleanup or lifecycle defect was identified.
Performance qualification: the storage microbenchmark supports the filter-before-Top-K/materialization optimization, but does not establish Wiki-10M, 100-client endpoint recovery. Local DOP still incurs per-reader scans/heaps and some request-payload copying; this is not a claim of zero amplification or full incident-scale performance recovery. The design expressly reserves representative distributed deployment acceptance for the future cross-CN route, which is absent here. In accordance with the review policy that missing test evidence alone need not block, I am not carrying forward the previous performance-evidence-only rejection as a production-code blocker. Keep #27854 performance recovery separately tracked until measured; this approval does not certify that workload's QPS target or authorize the deferred distributed route.
Evidence: current source/diff, historical owning-package and lifecycle/race validation for unchanged closures, revised protobuf contract, public SQL nonmember/empty-domain regression and focused ownership/shard tests. git diff --check passes. No new native package, race, Wiki-10M or multi-CN performance run is claimed, and I did not wait for CI. Approval is for the reviewed code/design scope, not a bypass of required checks.
aptend
left a comment
There was a problem hiding this comment.
Deep re-review of exact head cd8d0ebb8a14b817636841e1f564fc20da19aaba against base 3d67664696e48cec0efc84308fb7de1cfda2f7db.
I read the complete review/comment/reply/thread history and compared the previous reviewed head 136dffcc71f002614ed1b2bdf14367e6d9a47861 with this head. The four feature commits are unchanged; the later delta consists of main merges plus the protobuf-comment correction, so the prior P2 is fixed/resolved. A full-diff correctness and unhappy-path audit did not find an additional fail-open, lifecycle, hang, or double-release bug, but approval is still blocked by:
- The new inline finding: every local DOP reader copies the complete exact-domain payload, producing unadmitted O(DOP × domain bytes) transient heap per query.
- The previous issue-scale acceptance gap remains unresolved. #27854 is a Wiki-10M, 768-dimension, 3162-list, 3-CN, 100-client severity/s-1 performance regression.
TestIssue27854RequiredVectorDomainStaysCoordinatorLocaluses 124 rows, 3 dimensions,lists=1, CN0, and one connection, while the retained storage benchmark starts afterselectRowshas already been computed. Neither exercises PRE HashBuild/runtime-filter delivery, planner placement, local DOP construction, end-to-end candidate merge/recheck, or concurrent CPU/RSS. Please provide an exact main-vs-head representative A/B with QPS, p50/p95/p99, recall, per-CN CPU, peak RSS, and scanned-vector/byte evidence.
Validation on the exact head: relevant plan/compile/apply/IVF/plugin packages passed; focused shared-session/snapshot/required-domain race tests passed 10 runs; the embedded #27854 test passed; GitHub checks are green; git diff --check and a merge-tree against current main are clean.
…flat-search-domain-27854
Borrow the immutable generation-owned runtime-filter bytes when binding each reader search process instead of cloning the entire domain per shard. Drop each reader reference on Close without modifying sibling payloads or shared membership state. Add a 1 MiB domain regression at DOP 16 that verifies identical payload backing, one process allocation per reader, sibling validity after close, and distinct absent versus empty membership semantics.
aptend
left a comment
There was a problem hiding this comment.
[P1] The payload-copy blocker is fixed at exact head bf747e6: the runtime-filter bytes are now borrowed by local readers, sibling lifetimes remain valid, and the IVFFlat package, the declared local merge gate, and 20 focused race iterations pass.
The representative performance blocker at pkg/tests/issues/issue_27854_test.go:42 remains unresolved: #28002 (comment). In the supplied Wiki-10M round 1, this PR is 7.48 QPS versus main at 8.45 (-11.5%), with p95 28,898.85 ms versus 22,547.63 (+28.2%) and p99 32,243.35 ms versus 25,910.35 (+24.4%). Round 2 reverses direction, but main itself moves from 8.45 to 26.53 QPS (3.14x), so the sequential deployments are too noisy to attribute the difference to this patch. The measurements also predate bf747, the only new revision under this re-review.
Trigger: the reported 3-CN, concurrency-100, 10M-row PRE workload, especially a cold or contended deployment. Impact: this severity/s-1 performance fix can still worsen throughput and tail latency while leaving #27854 unresolved. Please rerun exact current main versus exact current head with interleaved/randomized repetitions and identical warm-up/data, and publish per-run QPS/p50/p95/p99 plus peak CPU/RSS and scanned embedding bytes. That provides a reproducible countercheck for both the coordinator-local path and the new payload-sharing memory claim.
|
Thanks for confirming that the payload-sharing blocker is fixed at bf747e6. I agree that the existing Wiki-10M A/B does not establish performance recovery. Round 1 is worse on the PR, while round 2 reverses direction; main itself changes from 8.45 to 26.53 QPS. These sequential runs do not isolate the patch effect, so they prove neither a reliable improvement nor a patch-caused regression. We also cannot attribute the variation specifically to cache warming or contention without measurements. The runs predate bf747e6. Its allocation/shared-backing regression proves that reader binding no longer copies the domain per shard; it does not prove reduced whole-query peak RSS or recovered endpoint throughput. The appropriate next validation is a pinned current-main/current-head comparison with identical data and query inputs, separately controlled cold and warmed phases, interleaved or randomized repetitions, and per-run QPS/p50/p95/p99/recall plus CPU, peak memory, and scanned embedding bytes. The current harness only takes before/after resource snapshots, so merely rerunning it would not close the resource-evidence gap. For scope clarity, the current design defers cross-CN domain fan-out and its enablement thresholds; this PR restores coordinator-local PRE semantics and local reader parallelism. That scope does not establish that #27854 performance recovery is complete. Although the inline thread is marked resolved, I am not treating that UI state or workflow success as performance acceptance. No additional code change is justified solely by these inconclusive measurements. |
Estimate initial entries-scan rows, blocks, vector bytes per row, and object count from the hidden index relation under the source account and snapshot. Keep result cardinality and output width separate, and use the existing wide-scan DOP policy with query, worker, object, and surrounding-operator caps. Carry the advisory estimate in the typed plan, preserve it across copies and serialization, and expose it in EXPLAIN. Missing statistics and async, correlated, or multi-round execution remain single-reader; required PRE domains stay coordinator-local. Cover the old DOP-1 failure, metadata and quantization boundaries, compiler reader cardinality, and a small persisted multi-object SQL fixture. Controlled Wiki-10M A/B remains required before default enablement; no incident-scale performance recovery is claimed.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Re-review of exact head 24538b9. REQUEST_CHANGES for the newly enabled costing revision's explicit acceptance gate.
[P1] Do not default-enable scan-work DOP before the required controlled performance evidence.
The new design section explicitly requires pinned main/candidate, fixed warm-up/data, three ABBA blocks at concurrency 1 and 100, per-run QPS/latency/recall plus CPU, peak memory and scanned bytes, and states that missing/inconclusive evidence does not pass. But apply_indices_ivfflat.go now attaches ScanWork for eligible synchronous scans unconditionally, and stats.go's CalcNodeDOP immediately uses it; there is no disabled-by-default enablement gate. No current-head evidence satisfying that design gate is attached.
This is not a claim that the old noisy Wiki runs prove a patch-caused regression: they do not, and they predate this costing revision. Nor can the 8,192-row storage microbenchmark or the reduced endpoint fixture establish representative concurrency-100 capacity/tail latency. The revision changes default reader scheduling, so the missing evidence belongs to THIS revision, not merely the future cross-CN route.
Fix/closure options: (1) attach the specified exact-head interleaved A/B results and show its thresholds pass; or (2) keep the new costing policy explicitly opt-in/default-off and deliver the already-validated exact-domain/payload-sharing repair separately, with issue #27854 performance recovery left open. Do not silently relabel the representative gate as future distributed-only: the final design section makes this a separate default-enablement requirement.
Reviewed the new estimate -> advisory protobuf/deep-copy -> CalcNodeDOP -> compile reader-cap chain. It separates physical entry width from output width and keeps unknown/invalid and adaptive paths conservative. Prior exact-domain/filter-before-Top-K and payload-sharing review evidence is reusable for the unchanged paths. The new documented estimate caveats (skew, fragmentation, small-domain fallback) reinforce the need for the controlled endpoint countercheck; they are not independent correctness findings.
This review stops approval at the objective performance-acceptance gate. No new representative benchmark or full native suite is claimed, and no CI wait was performed.
…flat-search-domain-27854 # Conflicts: # pkg/pb/plan/plan.pb.go
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep re-review of exact head 66ca7af against current PR base/merge-base ffabe50. No verified correctness, lifecycle, hang, or unbounded-growth blocker found in the current 30-file change.
I checked the complete production/test changes, the design and prior decisions, and generated protobuf serialization plus the decoded descriptor delta. The plugin interface and compiler/APPLY consumers agree on reader cardinality; registration/build-tag/ISCP contracts are unchanged. Required-domain DROP returns one empty reader per effective DOP, while PASS/malformed membership fails closed. Exact membership precedes storage Top-K, the final SQL predicate remains, and required PRE scans remain coordinator-local.
Q1-Q3 closure:
- Ownership: one search generation owns the admitted exact filter, centroid route and synchronized snapshot clone. Each local reader owns a disjoint shard and child context; partial construction balances unopened references. Relation scans release their filter share on early errors, and storage readers own independent shares until Close.
- Termination: runtime-filter waits and storage work inherit cancellable execution contexts. Session initialization is once per generation; no new uncancellable control-path dependency was found.
- Bounds: the payload is borrowed across local DOP, the filter/route are shared, candidate heaps/results retain their configured bounds, and last-reader cleanup releases the shared state. Reader DOP respects physical-work, object and worker caps; async/adaptive/correlated paths remain conservative.
Evidence reused: successful exact-head MatrixOne ALL CI run 34184530549 (UT/race, coverage, SCA and multi-CN BVT). Its UT log explicitly records TestIssue27854RequiredVectorDomainStaysCoordinatorLocal passing, including the persisted two-object DOP 1/2 and empty-domain controls. Existing focused lifecycle/race evidence was checked against the unchanged ownership closures. git diff --check passes. No new Wiki-10M benchmark is claimed.
Performance qualification: the scan-work policy is still enabled by default, and the controlled ABBA Wiki-10M/concurrency-100 acceptance in the design has not been demonstrated. The previous evidence-only objection is not carried forward as a blocking code finding under the current user-directed review policy. Approval does not certify those throughput/tail-latency/resource thresholds, resolve the incident-scale performance claim in #27854, or enable the deferred cross-CN route. Keep the controlled A/B and design acceptance record as explicit follow-up work.
What type of PR is this?
Which issue(s) this PR fixes:
issue #27854
What this PR does / why we need it:
Treat scalar PRE membership as a required exact search domain and preserve the domain-before-search phase in typed
VECTOR_INDEX_SCAN.Keep required-domain scans on the coordinator CN while restoring local reader DOP with disjoint shard identities, reader-owned child contexts, and one synchronized snapshot clone per search generation. Share centroid and membership state without sharing mutable readers.
Apply exact membership before bounded storage Top-K admission so nearer nonmembers cannot under-fill results. Cross-CN domain fan-out remains deferred until representative Wiki-10M performance and resource evidence supports it, so this change claims no new MORPC capability version.