Repository navigation
perf(plan): backport ODKU FULLTEXT maintenance optimizations - #29219
Conversation
Backport the ODKU irregular-index routing from matrixorigin#27956 and the value-aware synchronous FULLTEXT maintenance from matrixorigin#28066 onto hotfix-20260922. The release branch lacks the newer INSERT ALL and ordered-ODKU planner machinery, so this adaptation computes generated-column dependency closure directly against the hotfix planner while preserving conservative fallback behavior. (cherry picked from commit 5da2413) (cherry picked from commit 6eee646)
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? |
Match main while the local Iceberg E2E suite is stabilized; the Docker Hub minio/mc image used by this workflow is currently inaccessible. (cherry picked from commit 70b8d18)
XuPeng-SH
left a comment
There was a problem hiding this comment.
GPT-6 Astra medium deep review at exact head 4906066: REQUEST_CHANGES. [P1] Generated-primary-key changes can bypass synchronous FULLTEXT maintenance. In pkg/sql/plan/bind_insert.go around line 2780, dependency closure finds changed generated columns, but classification checks index-part/INCLUDE dependencies rather than document identity; this branch permits generated PK changes. A generated PK update can leave FULLTEXT postings under the old document identity while the row moves to the new PK, and the PK-inclusive equality path is not selected. Restore the dependency-aware immutable-PK guard or implement old-PK deletion plus new-PK insertion. [P2] Exact-head hotfix evidence is incomplete: attach revision-linked planner/package evidence and normal-comparison runs of both changed ODKU BVT cases, including teardown/rerun and a generated-PK regression. No additional confirmed defect was found in grouping, null transitions, unsupported-type fallback, or cleanup.
XuPeng-SH
left a comment
There was a problem hiding this comment.
GPT-6 Astra medium re-review at exact head 090ff78: REQUEST_CHANGES. [P2] Existing generated-column BVT still expects ON DUPLICATE KEY UPDATE a=5 with generated PK b=a*2 to succeed and produce (5,10), but the new immutable-key guard rejects it and preserves (1,2); update generated_column.result and run the normal-comparison case. [P2] The published exact-head validation is not attributable: the head/commands/case names are empty and the embedded build identifies unrelated commit 3e8f416; attach revision-linked commands, terminal reports, service identity, readiness/teardown, and same-instance comparison evidence. [P2] The implicit/generated-key contract lacks real planner-entry coverage; current helper tests manually provide changed columns and cannot prove seed/dependency expansion. Add explicit source to generated UNIQUE and implicit ON UPDATE to generated-key rejection cases plus an unrelated-update control. Historical generated-PK/FULLTEXT source defect is addressed.
XuPeng-SH
left a comment
There was a problem hiding this comment.
GPT-6 Astra medium re-review at exact head 38cb71f: REQUEST_CHANGES. Prior generated-PK/FULLTEXT implementation blockers are closed, including the corrected generated-column oracle and real planner-entry explicit/implicit dependency tests. [P2] The changed vector_ivfflat_include_dml_sync.sql contract has no reported execution evidence; run it in normal-comparison mode, verify teardown, and repeat on the same instance. [P2] The reported exact-head package/build and 439/439 BVT summaries still lack inspectable terminal reports, ISCP readiness evidence, and catalog teardown postconditions before reruns. Attach those records; hotfix branch-filtered CI and skipped Iceberg do not fill these gaps.
|
Exact-head validation artifacts for The gist contains the exact-head build output, package-test/vet/lint terminal logs, checksums, full |
XuPeng-SH
left a comment
There was a problem hiding this comment.
GPT-6 Astra medium force re-review: APPROVE. Reviewed all 18 changed files at exact head 38cb71f against base 9572bd3. Generated-key dependency closure and immutable PK/UNIQUE rejection, corrected generated-column oracle, real planner-entry tests, FULLTEXT identity/routing, and IVF INCLUDE maintenance are all closed. Inspected exact-head build/package/vet/lint/readiness and validation artifacts: generated-column 174, ODKU 265, IVF INCLUDE 55, 494/494 twice on the same instance, teardown counts zero, service log/manifest aligned and clean shutdown recorded. No blocking finding remains.
## What type of PR is this? - [ ] API-change - [x] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Related to #29214 and #27933. ## What this PR does / why we need it: Backport #29218 and #29219 from the independent `4.2-hotfix-20260922` line to `v4.2.1-hotfix`. Both cherry-picks apply without conflicts; their 20 delivered files are identical to the source hotfix. Omit the unrelated temporary Iceberg CI disable carried by #29218. - Resolve one common type across an entire VALUES column, preserving DECIMAL precision/scale, NULLs, character widths and VECF64 precision; reject mismatched vector dimensions independently of row order. - Skip synchronous irregular-index maintenance for ODKU conflicts whose indexed columns cannot change. Classic FULLTEXT also skips rebuilds when the final stored text is equal. New rows, changed indexed values, unsupported proof types and plugins retain maintenance; generated-key dependency guards and IVF INCLUDE payload updates are preserved. No catalog, index-storage or protocol migration is introduced. These optimizations do not claim to fix the cost of changed-text posting deletion or ordinary INSERT workloads. Validation (Linux/amd64, Go 1.26.4, CGO): - `make thirdparties`, `make cgo`, release `make build GOBUILD_OPT=-p=4`: PASS. - Focused regression selection and full normal suites for `pkg/sql/plan` and `pkg/fulltext/plugin/plan`: PASS. `pkg/indexplugin/plan` compiles successfully and has no test files. - Official mo-tester comparison, twice on the same isolated service: VALUES 26/26, ODKU 265/265, generated columns 174/174 and IVF INCLUDE DML 55/55; **520/520 per run**, no failed/ignored/abnormal statements. - Local SCA covers all 141 changed/reverse-dependent packages, including tests: `go vet -mod=readonly -p=4 <closure>` PASS; repository-pinned golangci-lint 2.6.2 `run --new-from-rev=origin/main <closure>` and the same check against `4711b18e82` PASS (`0 issues`). `molint check -mod=readonly -p=4 <closure>` has no new findings: its two unchanged unsafe-recover diagnostics reproduce identically on clean base `4711b18e82` with the same binary and package closure. - `gofmt` and `git diff --check`: PASS. --------- Co-authored-by: 和光同尘 <[email protected]>
What type of PR is this?
Which issue(s) this PR fixes:
issue #27933
What this PR does / why we need it:
Backport the ODKU irregular-index routing from #27956, the synchronous FULLTEXT optimization from #28066, and the generated-key safety guard from #28076 to
hotfix-20260922. This PR is independent of the VALUES fix in #29218.For
INSERT ... ON DUPLICATE KEY UPDATEon tables with classic synchronous FULLTEXT indexes:The backport also expands explicit assignments and implicit
ON UPDATEcolumns through generated-column dependencies before primary/unique-key and irregular-index classification. An ODKU that can change a generated primary or unique key is rejected before maintenance can use a stale document identity; unrelated assignments remain supported.Hotfix-specific adaptation:
INSERT ALLplanner path, so no corresponding change is included;Regression coverage includes real planner-entry tests for explicit and implicit generated-UNIQUE dependencies, an unrelated-update control, sink-consumer plan invariants, and distributed generated-column/ODKU cases. Existing FULLTEXT and vector-index maintenance coverage is retained.
The PR also carries main's temporary local Iceberg E2E disable while the workflow's Docker Hub dependency is unavailable.
Validation
Validated exact head
38cb71fcc3add986f99786fa9b29f5c90d159181:make build: PASS;./mo-service -versionreports branchbackport/28066-on-9572bd3, commit38cb71fcc3.GOWORK=off go test -count=1 -timeout=10m ./pkg/sql/plan ./pkg/fulltext/plugin/plan: PASS (4.552s,0.043s).GOWORK=off go vet ./pkg/sql/plan ./pkg/fulltext/plugin/plan ./pkg/indexplugin/plan: PASS.golangci-lint run -c .golangci.yml --new-from-rev 9572bd3311abb16d1df939956408a727bcf83eba ./pkg/sql/plan ./pkg/fulltext/plugin/plan ./pkg/indexplugin/plan: PASS (0 issues).127.0.0.1:6001after 11 seconds;select version(), 1returned8.0.30-MatrixOne-v2806695723, 1../run.sh -n -g -t 2:generated_column.sqlpassed174/174in both runs;on_duplicate_key_modern.sqlpassed265/265in both runs. Each combined run was439/439, 100%, with no failed/ignored/abnormal cases.Shutdown complete, exit 0).Full MatrixOne PR CI/BVT is not scheduled by the current workflow because its branch filter does not include base branch
hotfix-20260922.