Repository navigation
Conversation
Adapt main PR matrixorigin#30212 (18d5335) for the 4.2 planner, SDK and index metadata contracts. Refs matrixorigin#30185.
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? |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 981e88a63d8727fdf857d3eeead2d0f235714ca7
Assessment: request_changes
Factory-owned authorization and native binary persistence are coherent designs, but the legacy UPDATE planner violates the documented unchanged-source contract. A public SQL reproduction confirms the regression.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1
- P2
pkg/sql/plan/build_dml_util.go:341: Create an async FULLTEXT2 index on docs.path, insert a remote stage Datalink, then disable that stage. Execute UPDATE docs d JOIN peer p ON d.id=p.id SET d.status=2,p.status=2, targeting two distinct tables without assigning path.
Impact: The statement unnecessarily resolves the unchanged Datalink and fails, preventing unrelated updates after source invalidation. Apply the modern planner's assigned-source filtering to the legacy path, preserving full admission where alias merging requires it, and add this SQL regression case.
Evidence: dml_context.go routes multiple targets to the legacy planner, where this new code admits every indexed Datalink column. bind_update.go:419 instead selects assigned sources. The diagnostic TestReviewDistinctTargetAsyncDatalinkUpdate confirmed that single-table UPDATE docs SET status=1 succeeds, but the multi-table statement returns Error 20300: stage review_async_stage is disabled. Retained evidence: review-legacy-update-corrected.log and checks/1792172027946994263-2.json; production sources were unchanged.
Validation:
-
Preflight passed. Built native prerequisites from the frozen revision using repository Makefiles; verified the native input ledger and clean source fingerprint.
-
Passed 22 focused tests covering provider authorization, explicit credentials, cancellation, resource ownership, binary chunk boundaries and executor parameters.
-
Passed TestSQLFileAccessAuthorization, TestSQLFileAccessTenantStageCDC and TestSQLFileAccessPeerPersistence together in 118.914 seconds.
-
The corrected diagnostic SQL test reproduced the finding. Its initial run stopped at diagnostic SQL syntax and was excluded as product evidence.
-
Commands, source fingerprints, exit receipts, log outcomes and artifact hashes were reconciled in /home/xupeng/.local/state/mo-bot/jobs/22f26e414dfefb7922002b66/attempt-1/review-validation-audit.json.
Limitations:
-
Local tests used Go 1.27.1 on Linux/amd64. Full distributed BVT, race coverage, GPU runtime and comparative end-to-end performance remain outside executed validation.
-
Binary transport bounds batches but adds parameter copies; no whole-workload performance conclusion is established.
-
Frozen local_validation was empty and no separate linked-issue body was supplied. Author-only validation claims beyond the reproduced checks were not treated as verified execution.
|
Updated this PR in Addressed the disabled-stage unrelated-UPDATE finding: the legacy planner now checks final assigned/generated/automatic sources before delete/reinsert, preserves its executable row projection, and leaves carried sources alone on distinct physical targets. SQL regressions check both target values, preserved sources and row cardinality. Added a REPLACE/FK child control for the pre-remap path. Also corrected the FULLTEXT2 SUM/int64 contract and made tail-budget comparison overflow-safe. Validation (Go 1.26.4, Linux/amd64): three-CN file-access/CDC/persistence race tests PASS 121.272 s; planner focused race PASS 1.789 s and full normal UT PASS 4.112 s; compile full race PASS 5.059 s; FULLTEXT2 full normal/race PASS; complete PR incremental vet/lint across 23 CPU packages 0 issues. The exact quota test that failed obtaining a HAKeeper connection ID also passed isolated race, 17.136 s. Separate gpt-6.1-sol/xhigh design and independent final review: PASS for this scoped correction. Remaining baseline limits are explicit in the PR body. Clean target base |
|
mo-bot review · Commit: Review completed. Read the assessment. |
|
Fixed the latest review P2 in
Validation (Go 1.26.4, Linux/amd64): isolated pre-fix run reproduced all ten failures; fixed isolated normal/race passed (0.911 s / 2.852 s); existing data-branch/output/streaming tests passed under race with shuffled order for three rounds (22.962 s). Frontend vet and incremental configured lint against the PR merge base passed, 0 issues. Unchanged-package evidence is reused. Separate gpt-6.1-sol/xhigh design and final overall review both PASS for this correction. The independent baseline defects previously documented are not claimed fixed. No manual CI rerun or CI wait. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 0d1637598769ac85c029ede64665906c253925b7
Assessment: approve
Reviewed the complete 162-file delta, surrounding owners/callers and supplied review concerns. Factory-owned authorization, current-identity propagation and bounded binary persistence form a coherent design that preserves existing transaction ownership. Both previous findings are resolved. No actionable defects remain.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
Validation:
-
Verified frozen HEAD, clean source and supplied patch correspondence. Native recovery verified 170 matching inputs and retained build/output hashes.
-
Fresh Go 1.26.4 runs passed TestDataBranchCSVFinalizationCleanup normally and under race, exercising all ten cases. A shuffled race run passed 103 frontend tests for three rounds.
-
Independently reconciled 20 retained checks against commands, source fingerprints, exits and log contents. Their production and non-frontend test inputs match this head; the only subsequent change is the CSV test correction.
-
Retained public SQL authorization, tenant CDC and peer-persistence tests passed normally and under race, covering unrelated UPDATEs after stage invalidation, binary boundaries, rollback and cross-CN identity.
-
Verified passing owner-package and focused race results, plus the fileservice race suite and 100 lifecycle repetitions. Inspected fixture-only controls for parquet and HNSW directory failures; unsuccessful aggregate runs remain classified separately.
-
Controlled 64 MiB transport measurements showed approximately 9.4% more allocated bytes with binary parameters and median elapsed time of 1.04 s versus 0.90 s, with substantial variation. The bounded copying cost supports the security design but establishes no general performance gain.
-
Receipt/log reconciliation and detailed scope are retained in /home/xupeng/.local/state/mo-bot/jobs/c72b2bf205913a97fd4cbb2d/attempt-1/review-validation-audit.json and review-notes.json.
Limitations:
-
GPU execution, native ONNX runtime tests and the complete distributed BVT corpus were not established. Live-provider tests included skips; controlled provider and acquisition tests supplied the relevant authorization coverage.
-
The transport comparison uses the base SQL shape against the current engine, not separate base binaries or production throughput/P99 measurements.
-
Frozen local_validation was empty and no separate linked-issue body was supplied. Pending CI and unreceipted author claims were not counted as verified passes.
What type of PR is this?
Which issue(s) this PR fixes:
Addresses #30185 on 4.2-dev. Backports the merged main fix #30212 (
18d5335ee330bb7e3bd3a893bf81044120884021).Base:
e2c99334fd23b9260728695e29befd35ab26b454.What this PR does / why we need it
Table privileges must not confer authority over CN files or configured server file services. A clean 4.2-dev public-role SQL probe successfully read a fixture-owned CN canary; the fixed version rejects that access.
sys/moadminidentity at the existing SQL fileservice acquisition owner for local, named and dynamic-disk providers. Remote dynamic providers use explicit caller credentials, with no server credential discovery or local auxiliary files.load_fileINSERT paths rather than elevating internal SQL. Quote metadata values, including expression-looking IDs loaded from storage.LOCAL/INLINE input remains supported.4.2-specific adaptation
This is an adapted backport, not an unmodified cherry-pick:
IsEnd(it discards rows) or prepopulate a tagged filter's executable projection (the remapper owns that projection). No new protobuf field.Design and rollout contract:
docs/design/sql-file-access.md.Local validation
Go 1.26.4, Linux/amd64, source-matched native libraries, disk-backed temporary builds:
make cgoandmake build: passed (the normal build includesGOAMD64=v3,GOEXPERIMENT=simd).TestSQLFileAccessAuthorization,TestSQLFileAccessTenantStageCDC,TestSQLFileAccessPeerPersistencepassed together (117.762 s). Covers role/prepared reuse, denial before side effects, LOCAL import, tenant remote stages, post-CREATE CDC changes and old-term removal, local-to-TEXT CDC, binary boundaries, rollback/retry, HNSW literal-ID CDC persistence, compaction/default/view authority and forced cross-CN role transport.-short -run '^TestLoadS3(WithIndex)?$' ./pkg/tests/partition: passed (73.903 s), retaining four blocks and unique-index maintenance.-racetests passed across 11 owning packages, with an additional passing race run for the final HNSW/datalink/table-function adaptations.molint: no new diagnostics against the clean target base; the same 17 distinct pre-existing unsafe/recover messages (18 locations) occur on both versions. This is an incremental pass, not a claim that all existing findings are clean.GOMAXPROCS=4, 3 × 300 ms: base median 2153 ns/op, 9008 B/op, 25 allocs/op; backport 578.5 ns/op, 480 B/op, 10 allocs/op. This measures the reader path only; it does not establish whole-workload QPS/P99.Compatibility and limits
sys/moadminrole. Existing async local-Datalink indexes need remote sources or authorized foreground materialization into TEXT followed by rebuilding.Change-size review
Implementation +2201/-983, tests +4817/-468, design documentation +326/-0. The test increment covers distinct acquisition, identity, lifecycle and public SQL contracts; it is not exempt from review. Removed obsolete SQL artifact-reader generators, unused production test hooks/helpers and unrelated proxy test changes. No new privilege cache, global policy hook, duplicate storage format or background authority state machine.
Follow-up corrections
CAST(... AS SIGNED), including tail byte budgets and base row counts. Compare the tail byte bound before multiplication so large totals cannot wrap into an admitted load.Final correction validation uses Go 1.26.4, Linux/amd64, matching worktree native libraries and disk-backed, non-hidden temporary paths:
go vetand configured golangci-lint over all 23 affected CPU packages: passed, 0 issues. The final planner test correction also passed a fresh focused static check. Earlier GPU-tag typechecking/static evidence applies to unchanged GPU sources; GPU native runtime remains untested.gpt-6.1-sol/xhigh, revision-2 bounded correction design. Final assessment: PASS, no unresolved in-scope blockers, frozen correction fingerprint60b39a7e…(commitbf0988190befdae412217f47d98bb56352e2d637).Known independent baseline failures are not hidden by changed expectations or retries:
protected_database.sqlcase-variant CREATE/DROP mismatches were reproduced on clean4.2-devbasee2c99334fdwith separate CN processes. The same-process control denies them correctly. Existing peer sessions keep stale per-process global configuration after another CN changesprotected_databases.col3/len3). A broader delete-owner experiment was rejected because its overlap control duplicated rows; none of those execution-owner changes is included here. This PR preserves that baseline execution path and fixes its new source-admission boundary.SET ROLEcould execute. That exact test passed a fresh isolated race run (17.136 s); no quota/file-policy code was changed for the connection failure..cachepaths reproduce failures on clean base as well.Remote CI has not been declared green or awaited.
Correction size: production +75/-27 (net +48), tests +95/-1 (net +94), tracked documentation +0/-0. No new persistent state, workers, caches or execution ownership path.
CSV cleanup test isolation
The latest review found an order-dependent fixture in
TestDataBranchCSVFinalizationCleanup: it asserted that another test had already registered the service runtime. The test now supplies a neutral default when no previous runtime exists and registers restoration/batch cleanup before installing its mock executor. An existing runtime is restored unchanged. All ten real CSV success, finalization, cancellation and authorization cases keep their original assertions. Production code is unchanged; this follow-up is test-only, +4/-2 lines.Validation on Go 1.26.4 / Linux amd64 with matching native libraries:
Before the fix, isolated execution failed all ten cases at the missing-runtime assertion (0.038 s).
Isolated normal and race execution: passed (0.911 s / 2.852 s).
Existing data-branch, output validation and streaming tests under race,
-shuffle=30433 -count=3: passed (22.962 s).Frontend
go vetand configured incremental golangci-lint against merge basee2c99334fd: passed, 0 issues. Prior full-delta evidence remains applicable to unchanged packages.Solution/design and independent final review:
gpt-6.1-sol/xhigh, PASS for correction0d1637598769ac85c029ede64665906c253925b7(diffc4fc5ac8…). The existing baseline limitations above remain unchanged; remote CI is pending.