Repository navigation
fix(ivfflat): integrate exact PRE storage Top-K and gate local DOP - #28515
Conversation
Require standalone scalar PRE domains on both runtime-filter producer and consumer using MustApply. Validate the terminal payload before opening entry readers, fail closed on unavailable or malformed required input, and keep required scans on the coordinator independently of placement hints. Use a shared exact integer membership filter for storage Top-K, and the existing fused filter-before-Top-K path for residual or noninteger required predicates. Carry the small-domain all-centroids decision explicitly and constrain that scan with a version prefix. Preserve existing nprobe, candidate budgets, visibility, distance semantics, final rechecks, and exact fallback paths. Add default-off vectorLocalDOP=1 scheduling for synchronous, uncorrelated, single-round integer PRE searches. Estimate physical work from hidden entries statistics, preserve it through plan copying, serialization and EXPLAIN, and cap parallelism by scan work, objects, CPU and max_dop. Recheck the current gate when compiling execution so cached plans cannot retain disabled parallelism. Prepare one generation-owned domain, metadata version, centroid route and snapshot before publishing disjoint local readers. Give each reader independent scan state and cancellation, retain logical CN/cache identity, aggregate round diagnostics, and release shared resources after the last reader closes. Keep Hooks.NewReader and correlated APPLY interfaces unchanged.
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.
Deep review of exact head 12660a7 against cd04bb4. No confirmed blocking correctness, lifecycle, liveness, or compatibility finding.
Design: reviewed the separately committed, version-linked design at 23d4a97 and the #28002 decision history. The coordinator-local, shared-generation contract is sound; the new scheduling policy is explicitly opt-in and rechecked at execution compilation. Accepting this scoped design does not certify Wiki-10M performance recovery or authorize default-on/cross-CN rollout.
Coverage: all 30 changed files, including generated protobuf code and decoded descriptor delta. Required producer/consumer domains fail closed before entries open; empty domains preserve reader cardinality. Exact integer membership reaches storage before Top-K, while noninteger/residual predicates retain filter-before-Top-K and unsupported ordering retains the exact fallback. The explicit all-centroid route remains version constrained; final SQL rechecks and ANN candidate/nprobe semantics remain distinct from globally exact nearest-neighbor search.
Ownership/liveness: one generation seals domain, metadata version, centroid route and snapshot before publishing disjoint local readers. Reader contexts and scan state are independent; construction/reference cleanup and last-reader release balance shared filter ownership without cancelling siblings or the parent transaction. Storage filter shares are released on early errors and normal close. DOP remains bounded by work/object/CPU/query caps; missing statistics and unsupported execution modes stay conservative. Hooks.NewReader/APPLY and persistent index encoding are unchanged; the protobuf descriptor adds only advisory scan_work=18 and its four-field message.
Evidence reused: successful exact-head CI run 34325427836, including race UT, coverage, SCA and multi-CN BVT. Its UT log explicitly records TestIssue27854RequiredVectorDomainStaysCoordinatorLocal passing in 3.46 seconds; the test checks real persisted objects, DOP 1/2 results and empty-domain handling. Reviewed the targeted generation/admission/malformed-input, storage-path, hint/cost, prepared-execution and noninteger SQL oracles, together with the author's documented normal/race and same-instance BVT results. No new local native suite or representative performance benchmark is claimed.
Merge Queue Status
This pull request spent 58 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonPull request #28515 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. Tick the box to put this pull request back in the merge queue (same as
|
…atrixorigin#28515) ## What type of PR is this? - [ ] API-change - [x] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Related to matrixorigin#27854. Replaces the remaining exact-PRE integration and local-DOP scope of matrixorigin#28002 on main after matrixorigin#28488; matrixorigin#28002 is left unchanged and open. ## What this PR does / why we need it: Require standalone scalar PRE domains on both runtime-filter producer and consumer using `MustApply`. Validate the terminal payload before opening entry readers, fail closed on unavailable or malformed required input, and keep required scans on the coordinator independently of placement hints. Use a shared exact integer membership filter for storage Top-K, and the existing fused filter-before-Top-K path for residual or noninteger required predicates. Carry the small-domain all-centroids decision explicitly and constrain that scan with a version prefix. Preserve existing nprobe, candidate budgets, visibility, distance semantics, final rechecks, and exact fallback paths. Add default-off `vectorLocalDOP=1` scheduling for synchronous, uncorrelated, single-round integer PRE searches. Estimate physical work from hidden entries statistics, preserve it through plan copying, serialization and EXPLAIN, and cap parallelism by scan work, objects, CPU and `max_dop`. Recheck the current gate when compiling execution so cached plans cannot retain disabled parallelism. Prepare one generation-owned domain, metadata version, centroid route and snapshot before publishing disjoint local readers. Give each reader independent scan state and cancellation, retain logical CN/cache identity, aggregate round diagnostics, and release shared resources after the last reader closes. Keep `Hooks.NewReader` and correlated APPLY interfaces unchanged. ## Design and rollout The [approved design](https://github.com/aunjgr/matrixone/blob/23d4a971b4/docs/design/exact_pre_storage_local_dop.md) was recorded before implementation. This reuses main's `must_apply=12`, appends advisory `scan_work=18`, and integrates the storage paths already present after matrixorigin#28488. Exact membership is not globally exact ANN search. Local DOP stays off unless `optimizer_hints='vectorLocalDOP=1'` is selected. Controlled Wiki-10M A/B/C evidence remains a prerequisite for proposing default-on; this PR makes no workload-speedup claim. ## Validation - Normal owning-package tests: planner, EXPLAIN, compiler, IVF-FLAT plugins/readers and SQL scan adapter. - Owning-package race tests for IVF-FLAT, SQL scan adapter and compiler; 100 focused repetitions of concurrent shared-generation readers, including one shared historical snapshot clone. - Two-CN SQL regression using 125 rows, two explicitly flushed entries objects and injected cost statistics: identical results at DOP 1/2, required empty-domain handling and coordinator-local placement. - Extended 30-statement BVT and existing 68-statement end-to-end BVT each passed twice on the same instance; database teardown verified between runs. - Required-domain malformed/type/null/cardinality/PASS/cancellation rejection, memory-admission denial and partial-construction cleanup; exact integer, string, residual, full-centroid and descending-fallback storage paths. - `make config static-check`: package graph, repository lint, license checks and golangci-lint. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…atrixorigin#28515) ## What type of PR is this? - [ ] API-change - [x] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Related to matrixorigin#27854. Replaces the remaining exact-PRE integration and local-DOP scope of matrixorigin#28002 on main after matrixorigin#28488; matrixorigin#28002 is left unchanged and open. ## What this PR does / why we need it: Require standalone scalar PRE domains on both runtime-filter producer and consumer using `MustApply`. Validate the terminal payload before opening entry readers, fail closed on unavailable or malformed required input, and keep required scans on the coordinator independently of placement hints. Use a shared exact integer membership filter for storage Top-K, and the existing fused filter-before-Top-K path for residual or noninteger required predicates. Carry the small-domain all-centroids decision explicitly and constrain that scan with a version prefix. Preserve existing nprobe, candidate budgets, visibility, distance semantics, final rechecks, and exact fallback paths. Add default-off `vectorLocalDOP=1` scheduling for synchronous, uncorrelated, single-round integer PRE searches. Estimate physical work from hidden entries statistics, preserve it through plan copying, serialization and EXPLAIN, and cap parallelism by scan work, objects, CPU and `max_dop`. Recheck the current gate when compiling execution so cached plans cannot retain disabled parallelism. Prepare one generation-owned domain, metadata version, centroid route and snapshot before publishing disjoint local readers. Give each reader independent scan state and cancellation, retain logical CN/cache identity, aggregate round diagnostics, and release shared resources after the last reader closes. Keep `Hooks.NewReader` and correlated APPLY interfaces unchanged. ## Design and rollout The [approved design](https://github.com/aunjgr/matrixone/blob/23d4a971b4/docs/design/exact_pre_storage_local_dop.md) was recorded before implementation. This reuses main's `must_apply=12`, appends advisory `scan_work=18`, and integrates the storage paths already present after matrixorigin#28488. Exact membership is not globally exact ANN search. Local DOP stays off unless `optimizer_hints='vectorLocalDOP=1'` is selected. Controlled Wiki-10M A/B/C evidence remains a prerequisite for proposing default-on; this PR makes no workload-speedup claim. ## Validation - Normal owning-package tests: planner, EXPLAIN, compiler, IVF-FLAT plugins/readers and SQL scan adapter. - Owning-package race tests for IVF-FLAT, SQL scan adapter and compiler; 100 focused repetitions of concurrent shared-generation readers, including one shared historical snapshot clone. - Two-CN SQL regression using 125 rows, two explicitly flushed entries objects and injected cost statistics: identical results at DOP 1/2, required empty-domain handling and coordinator-local placement. - Extended 30-statement BVT and existing 68-statement end-to-end BVT each passed twice on the same instance; database teardown verified between runs. - Required-domain malformed/type/null/cardinality/PASS/cancellation rejection, memory-admission denial and partial-construction cleanup; exact integer, string, residual, full-centroid and descending-fallback storage paths. - `make config static-check`: package graph, repository lint, license checks and golangci-lint. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…atrixorigin#28515) ## What type of PR is this? - [ ] API-change - [x] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Related to matrixorigin#27854. Replaces the remaining exact-PRE integration and local-DOP scope of matrixorigin#28002 on main after matrixorigin#28488; matrixorigin#28002 is left unchanged and open. ## What this PR does / why we need it: Require standalone scalar PRE domains on both runtime-filter producer and consumer using `MustApply`. Validate the terminal payload before opening entry readers, fail closed on unavailable or malformed required input, and keep required scans on the coordinator independently of placement hints. Use a shared exact integer membership filter for storage Top-K, and the existing fused filter-before-Top-K path for residual or noninteger required predicates. Carry the small-domain all-centroids decision explicitly and constrain that scan with a version prefix. Preserve existing nprobe, candidate budgets, visibility, distance semantics, final rechecks, and exact fallback paths. Add default-off `vectorLocalDOP=1` scheduling for synchronous, uncorrelated, single-round integer PRE searches. Estimate physical work from hidden entries statistics, preserve it through plan copying, serialization and EXPLAIN, and cap parallelism by scan work, objects, CPU and `max_dop`. Recheck the current gate when compiling execution so cached plans cannot retain disabled parallelism. Prepare one generation-owned domain, metadata version, centroid route and snapshot before publishing disjoint local readers. Give each reader independent scan state and cancellation, retain logical CN/cache identity, aggregate round diagnostics, and release shared resources after the last reader closes. Keep `Hooks.NewReader` and correlated APPLY interfaces unchanged. ## Design and rollout The [approved design](https://github.com/aunjgr/matrixone/blob/23d4a971b4/docs/design/exact_pre_storage_local_dop.md) was recorded before implementation. This reuses main's `must_apply=12`, appends advisory `scan_work=18`, and integrates the storage paths already present after matrixorigin#28488. Exact membership is not globally exact ANN search. Local DOP stays off unless `optimizer_hints='vectorLocalDOP=1'` is selected. Controlled Wiki-10M A/B/C evidence remains a prerequisite for proposing default-on; this PR makes no workload-speedup claim. ## Validation - Normal owning-package tests: planner, EXPLAIN, compiler, IVF-FLAT plugins/readers and SQL scan adapter. - Owning-package race tests for IVF-FLAT, SQL scan adapter and compiler; 100 focused repetitions of concurrent shared-generation readers, including one shared historical snapshot clone. - Two-CN SQL regression using 125 rows, two explicitly flushed entries objects and injected cost statistics: identical results at DOP 1/2, required empty-domain handling and coordinator-local placement. - Extended 30-statement BVT and existing 68-statement end-to-end BVT each passed twice on the same instance; database teardown verified between runs. - Required-domain malformed/type/null/cardinality/PASS/cancellation rejection, memory-admission denial and partial-construction cleanup; exact integer, string, residual, full-centroid and descending-fallback storage paths. - `make config static-check`: package graph, repository lint, license checks and golangci-lint. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
Related to #27854. Replaces the remaining exact-PRE integration and local-DOP scope of #28002 on main after #28488; #28002 is left unchanged and open.
What this PR does / why we need it:
Require standalone scalar PRE domains on both runtime-filter producer and consumer using
MustApply. Validate the terminal payload before opening entry readers, fail closed on unavailable or malformed required input, and keep required scans on the coordinator independently of placement hints.Use a shared exact integer membership filter for storage Top-K, and the existing fused filter-before-Top-K path for residual or noninteger required predicates. Carry the small-domain all-centroids decision explicitly and constrain that scan with a version prefix. Preserve existing nprobe, candidate budgets, visibility, distance semantics, final rechecks, and exact fallback paths.
Add default-off
vectorLocalDOP=1scheduling for synchronous, uncorrelated, single-round integer PRE searches. Estimate physical work from hidden entries statistics, preserve it through plan copying, serialization and EXPLAIN, and cap parallelism by scan work, objects, CPU andmax_dop. Recheck the current gate when compiling execution so cached plans cannot retain disabled parallelism.Prepare one generation-owned domain, metadata version, centroid route and snapshot before publishing disjoint local readers. Give each reader independent scan state and cancellation, retain logical CN/cache identity, aggregate round diagnostics, and release shared resources after the last reader closes. Keep
Hooks.NewReaderand correlated APPLY interfaces unchanged.Design and rollout
The approved design was recorded before implementation. This reuses main's
must_apply=12, appends advisoryscan_work=18, and integrates the storage paths already present after #28488.Exact membership is not globally exact ANN search. Local DOP stays off unless
optimizer_hints='vectorLocalDOP=1'is selected. Controlled Wiki-10M A/B/C evidence remains a prerequisite for proposing default-on; this PR makes no workload-speedup claim.Validation
make config static-check: package graph, repository lint, license checks and golangci-lint.