Repository navigation
Fix native preparation and stabilize CI tests - #32574
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? |
|
This pull request is merged. |
|
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: ad48b2ccc84ba418e6edead76d27189acec380cb
Assessment: approve
The test-only changes reuse existing fixture ownership and quarantine, preserve substantive assertions, and reduce repeated fixture work. Session pinning, bounded phases and failure propagation address the documented cascades. No actionable defects remain.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
Reviewed the complete 11-file delta, affected owners and consumers, all discussion entries, and all seven linked issues with their supplied comments.
-
Static audit passed: frozen HEAD/base, unchanged tracked source, matching delta, git diff --check, gofmt and complete discussion coverage. Receipt: checks/1794417385888024394-3.json; log: static-audit-final.log.
-
Assessed the frozen author's Linux normal/race validation report, including three complete prepared-parameter runs with all 320 named events.
Limitations:
-
Go tests were not independently rerun; raw logs for the author's runtime validation were not supplied.
-
Frozen CI UT/SCA checks remain pending; full-lane timing stability is unproven.
-
Live-worker recovery during the invalid-stage interval and incidental four-block sort scale are intentionally no longer exercised. The separately referenced flush and timeout incidents remain unresolved.
|
mo-bot review · Commit: "interrupted" |
|
mo-bot review · Commit: PR closed or head changed |
|
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: 1ec57307c744cfab6da24804d2f5cbc19a6e0707
Assessment: approve
The fixes reuse GNU Make, existing fixture ownership and the MVCC-aware tombstone collector without adding parallel mechanisms. The complete scope preserves substantive test oracles; no actionable findings remain.
Model: gpt-6.1-sol / max
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
Validation:
-
Reviewed all 18 changed files, affected owners/consumers, seven discussion entries and ten linked issues; saved complete discussion coverage.
-
Linux/amd64 Go 1.27.1, CGO/SIMD: 127 TAE tables named passes, five real-engine range/flush/replay passes, and 15 focused race passes. All Go tests used the assigned test-exec.
-
Passed 100 repetitions of each new scanner/unknown-memory/empty-flush regression, 83 persisted-scan repetitions, and gossip collision checks in normal/race modes plus 29 normal repetitions.
-
Native Make regression, both existing native contract suites and a fresh native build passed. Gofmt, go vet, pinned molint and incremental golangci-lint passed for the changed Go closure.
-
validation-summary.json reconciles 24 checks with retained logs and receipts. Final audit passed: checks/1794435117498571919-2.json.
Limitations:
-
Reused supplied author normal/race reports for eleven byte-identical, previously reviewed fixture files; their raw runtime logs were unavailable.
-
Frozen UT/SCA CI checks remained in progress. Full-lane timing stability and macOS/GPU native execution were not independently validated.
-
Live-worker recovery during the invalid-stage interval and incidental four-block sort coverage remain intentionally excluded.
-
The separate GetValue panic in #32185 and referenced timeout/flush incidents remain unresolved; the original failing object's metadata was not reconstructed.
|
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: 071380402a525fd6696823a735ccca4537cc63ea
Assessment: approve
The fixes reuse GNU Make, existing fixture cleanup/quarantine and the MVCC-aware tombstone collector. Substantive test oracles are preserved; no actionable findings remain.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
Native Make regression passed all three groups; receipt checks/1794444131560853981-3.json and retained native-makeflags.log.
-
Final static audit passed: frozen range, unchanged source, formatting of 17 Go files and complete nine-entry discussion coverage; receipt checks/1794444569985161283-4.json.
-
Verified prior-head evidence remains applicable outside the two isolated cleanup files; reused supplied normal/race/stress/SCA reports and author-reported final-head restore/EXCEPT ALL race passes.
Limitations:
-
Go tests and native builds were not rerun locally; raw logs for reused runtime reports were unavailable. Full UT/SCA/coverage/BVT CI lanes remain pending.
-
Live-worker invalid-stage recovery and incidental four-block sort scale are intentionally excluded. The separate GetValue panic and referenced timeout/shutdown causes remain unresolved; loaded-runner stability is unproven.
…ings (#32573) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Related to #32444 ## What this PR does / why we need it: ### Root cause 1. `GRANT SELECT ON TABLE <view>` (and the bare `GRANT SELECT ON <db>.<view>` spelling) stores the privilege in `mo_catalog.mo_role_privs` under the **table** object class against the view's relation id, but `verifyViewPrivilegeForRole` only matched **view**-class rows, so a granted, role-activated SELECT was still rejected at query time with `internal error: do not have privilege to execute the statement` (issue #32444). 2. The revoke counterpart had two asymmetries: - the relation delete templates matched a single stored `privilege_level` ("d.t" or "t"), while enforcement honors both, so a revoke written in one qualification spelling (qualified vs unqualified) left the row stored under the other spelling and the object stayed authorized for fresh sessions; - the cross-class relation delete was selected by object type alone, so wildcard scopes (`db.*`) also used it and wrongly removed independent wildcard grants of the other object class on the same database, and `REVOKE ALL` only deleted the table-all row instead of every privilege row of the exact object. ### Exact change - `pkg/frontend/authenticate.go` - `verifyViewPrivilegeForRole` re-probes the legacy table-class grant at the exact-relation privilege levels (`exactRelationPrivilegeLevels`: "d.t"/"t") after the view-class sweep misses, and caches the honored result under the view class; table-class wildcard grants (`db.*`, `*`, `*.*`) stay distinct from view access. - New relation delete templates (`deleteRelationRolePrivsFormat`, `deleteRelationAllRolePrivsFormat`) delete rows of both stored object classes (`obj_type in ("table","view")`) and both qualification spellings (`privilege_level in ("d.t","t")`) for the resolved relation id; `REVOKE ALL` on an exact relation drops the `privilege_id` filter and clears every privilege row on that identity; wildcard scopes and account/database-class scopes keep the legacy class-specific delete. - `pkg/frontend/authenticate_test.go` / `pkg/frontend/select_lock_privilege_test.go` — focused UT regressions: exact-relation TABLE/VIEW revokes (SELECT and ALL, both spellings), unqualified exact revoke, class-specific legacy deletes for `db.*`/`*.*`/account with negative asserts, and catalog-lock fixtures. - `test/distributed/cases/zz_accesscontrol/grant_view_table_spelling.sql` (+ generated `.result`) — user-visible BVT: grants through every accepted spelling authorize a fresh session; a revoke in the other qualification spelling or the other object wording ends authorization in a fresh session; `REVOKE ALL` removes layered SELECT+ALL grants on views and base tables; wildcard grants of one object class survive the other class's wildcard revokes and end only at the same-class revoke; denials recorded as the documented privilege error. The case snapshots the sys-account `enable_privilege_cache` global at entry with a value oracle and restores the genuine captured original value at cleanup (the `tenant/privilege/bare_object_grant.sql` pattern), so running the case with the cache already OFF no longer persists ON into later sessions and cases. ### Proof (issue to test) - Original reproduction (issue #32444): the exact reported sequence (view granted via `ON TABLE` to an activated role, root can query the view, `SELECT * FROM` the view by the granted user fails) fails on the assigned base binary and passes with this change. The stored authorization row is visible in `mo_catalog.mo_role_privs` with `obj_type='table'` against the view's `obj_id`, and the granted user's SELECT returns the view's rows. - UT proof: `Test_doRevokePrivilege` (pkg/frontend) asserts the emitted catalog delete SQL for every revoke routing — exact-relation TABLE/VIEW SELECT and ALL at both qualification spellings, the unqualified table-select case, and the unchanged legacy class-specific path for `db.*`, `*.*` and account scopes, with explicit negative asserts that the wildcard deletes contain neither the cross-class nor the both-level in-clause; focused run PASS (137 convey assertions), full `pkg/frontend` suite PASS. - BVT proof: `grant_view_table_spelling.sql` passes 110/110 with this change; the same BVT fails 7 rows on the true-base binary (5 rows = the original view-enforcement defect, 2 rows = authorization surviving `REVOKE ALL` through a leftover row). The regenerated `.result` was inspected statement-by-statement: authorizations, fresh-session denials and preserved wildcard grants match the intended semantics. Review-cleanup revision re-validated locally: the case is green 110/110 twice in a row on one instance, and under the review's counterexample (sys-account `enable_privilege_cache` already OFF) the pre-fix cleanup left the global ON while the fixed case restores the captured OFF, which its restore oracle records. - Independent black-box challenge replays (cache lifecycle across `enable_privilege_cache` off/on and after an off-to-on switch): fail pre-repair, pass post-repair; pre-PR review counterexample probe (cross-spelling and cross-class revokes) reproduces both defects pre-fix and shows both fixed post-fix. - Adjacent-behavior guards on the revised binary: `zz_accesscontrol/revoke_privs_role.sql` 58/58, `tenant/privilege/role3.sql` 200/200, both green. ### Test commands - UT: `cd pkg/frontend && go test -run 'Test_doRevokePrivilege' -count=1` (focused), `go test -count=1` (full package) — both PASS on macOS arm64 with the repository CGo environment. - BVT: `test/distributed/cases/zz_accesscontrol/grant_view_table_spelling.sql` runs in CI via mo-tester against the committed `.result`. - Static: `gofmt -l` clean, `go vet ./pkg/frontend/...` exit 0, `golangci-lint run -c .golangci.yml --new-from-rev HEAD ./pkg/frontend` 0 issues. ### Residual risks - Deliberate tightening: an exact-relation revoke now removes the grant whichever qualification spelling or object wording stored it, and `REVOKE ALL` clears every privilege row on the object identity; anyone relying on a cross-spelling leftover to keep a role authorized will lose that access. - Wildcard revokes remain class-specific by `ON TABLE` / `ON VIEW` wording (documented); an exact-relation revoke does not remove database- or account-level grants. - `SHOW GRANTS` rendering for view grants (literal `d.t`) is a separately reported display issue and is unchanged here. ### Base update (2026-11-12) Rebased onto `main` at `4760bcaa88` to pick up the merged CI-stabilization fixes for #32424 and #32563 (PR #32574); this PR's own diff is unchanged (same five files, 968 insertions / 2 deletions). Focused UT re-validated on the new base via `mo-cgo-test -count=1 -run ... ./pkg/frontend` (macOS arm64, repository CGo wrapper): `TestVerifyViewPrivilegeForRoleHonorsTableSpellingGrant`, `TestVerifyViewPrivilegeForRoleTableSpellingGrantCachePromotion`, the extended `TestSelectLockViewAlternativesAndErrors`, and the `Test_doRevokePrivilege` revoke-routing case set all PASS. Approved-by: XuPeng-SH <[email protected]>
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #32392
Fixes #32420
Fixes #32424
Fixes #32561
Fixes #32562
Fixes #32563
Refs #32324
Refs #32544
Refs #32570
Refs #32185
What this PR does / why we need it:
Native build preparation was skipped when GNU Make put a command-line variable assignment first in
MAKEFLAGS, causing the final provenance record to fail. The preparation recipe now lets Make decide whether it runs in dry-run, touch and question modes, instead of parsing Make flags and assignments. Its cleanup sub-makes can fall back to serial execution and emit a jobserver warning with pipe-based GNU Make jobservers; the subsequent native build retains its existing recursion and parallelism.The real gossip bind-collision test now uses the same wildcard TCP address-family selection as memberlist and asserts that the collision is from the expected gossip TCP host and port. On macOS, the former IPv4-only injection could coexist with memberlist’s IPv6 listener, so the intended retry was never tested. The new native Make target regression also runs on the existing macOS native-contract job without adding another job or expanding the workflow’s path trigger.
Several integration tests spend one deadline across independent SQL scenarios or teardown. A late scenario then starts with an expired context, and dependent scenarios can continue on a canceled session. Give the independent subscription, temporary-table, branch-diff and prepared-parameter scenarios bounded lifetimes, stop dependent work after a failure, and keep cleanup with the owner that can perform it. The watermark test's final database drop also gets its own bounded cleanup context.
The intentional 2.5-second cancellation check no longer leaves that limit on the following spill query. The full-text fixture pauses its single-CN CDC executor while its stage is deliberately invalid, restores the stage before resuming, and retains the same-job completion, watermark and MATCH assertions. The invalid-stage interval no longer exercises a live worker's recovery after a permanent job error.
The prepared-parameter test keeps its complete protocol/read/write matrix. Session-bound PREPARE and wire-rewrite tests now pin the connection; numeric negative tests check the actual server error, and a failed fixture does not start competing table or database drops. Each matrix case sets its text-protocol variables once, including when only the write leaf is selected.
Test work is reduced by combining paired rollback checks, right-sizing small admission inputs, sharing spill result checks, and sharing one 8,193-row aggregate/sort fixture. All six aggregate/sort transitions and per-row checks remain. This replaces the previous 16,384-row aggregate input and 32,768-row sort input; the sort no longer covers that incidental four-block scale.
The linked refs are deliberately not closed by this PR. In #32324 the reported line is the final DROP, whose prior shared context had nearly expired; the reason for the slow server operation and its unknown commit outcome remain unproven. In #32544 the branch-diff deadline cascade is addressed, but a separate prepared-cache flush timeout remains. #32570 also tracks five other timeout roots whose causes are not established by this parameter-test fix.
Validation
make cgoassignment. The GNU 3.81 before/after control was an incremental Linux build; a separate GNU 4.4.1 Linux run rebuilt the CGo and third-party libraries from cleaned source using a checksum-verified prebuilt ONNX library. Both ran in source-archive copies, whose artifacts are correctly marked non-reusable. macOS/arm64 and GPU have not been tested. Real rebuild-all cleanup was also checked under 3.81; the candidate produced two jobserver-unavailable warnings and completed all cleanup. The CI Node suite passed 50 tests; the targeted Make regression also passed on macOS/arm64 with Node 22 and system GNU Make 3.81.static-check-selectedwith pinnedmolintandgolangci-lintforpkg/embed,pkg/iscp,pkg/logservice,pkg/tests/dml,pkg/tests/issues,pkg/tests/sqlintegrationandpkg/tests/upgrade; all passed.GOEXPERIMENT=simd,-short -tags matrixone_test: all six owning packages passed in normal mode; the Go source and tests covered by those runs had not changed at that point. Completepkg/embedandpkg/tests/sqlintegrationpackages passed under-race; the changed ISCP, DML, upgrade and issues roots also passed under-race. The complete prepared-parameter root passed three times, with all 320 named test events present on each run.EXPLAIN ANALYZEcontrols still observed both aggregate and sort spilling at the low threshold; those controls are separate queries, not timings of the original six stages. Short before/after samples do not establish a reliable CI wall-time improvement.gpt-6.1-terrawith max reasoning; review findings were corrected and revalidated.Additional #32185 range-scan panic fix
The rebased branch also handles tombstone objects whose object-level rowid zonemap is uninitialized. Such metadata cannot prove that the target rowid is absent, so the scan now delegates to the existing owner-aware tombstone collector. Initialized summaries keep the existing O(1) negative-prune path. If collection fails after an earlier candidate contributed rows, the partial result batch is closed before the error returns. The tests cover a real empty tombstone flush/replay, a non-empty in-memory tombstone with unknown object stats, valid-summary pruning, persisted-object differential behavior, missing object data, and partial-result cleanup. The old-code overlay reproduces the
RowidPrefixEqpanic for the empty-flush case.This addresses only the uninitialized object-level-ZM scan panic reproduced by the empty tombstone lifecycle. It does not fix the independent historical
GetValuerow-offset panic or establish the state of the object in the original CI failure; #32185 remains open and is referenced, not closed. No latency or allocation improvement is claimed: initialized summaries add one O(1) initialized-bit check, while unknown non-empty candidates use the necessary existing collector path.Validation on rebased HEAD
1ec57307c7(based on mainc8accd138b)pkg/vm/engine/tae/tables: full package normal and-raceboth passed (127 terminal test events each).pkg/vm/engine/tae/db/test: full package-racepassed (318 test PASS events, one pre-existingTestUpdateSKIP; 73.981s).TestCollectAppendWaitsForTxnPrepareTS: adaptive race repetition passed 100/100.static-check-selectedfor both changed TAE packages passed with 0 issues.gpt-6.1-terramax review: APPROVE for this commit and bounded fix scope. The review explicitly notes that this is not a complete fix for [Bug]: TestDelete4 intermittently panics in GetValue and tombstone RowidPrefixEq during race CI #32185. The pre-rebase PR validation above remains labeled where applicable; the branch patch IDs were preserved across rebase, but the evidence here is the exact current-HEAD TAE rerun.CI failure follow-up on
071380402aThe race UT on
1ec57307c7passed both SQL topologies inTestIssue28234ExceptAllClusterbut failed during cluster shutdown when CN final metadata withdrawal timed out. The cluster's LogService had already logged repeated Raft tick and heartbeat timeouts, while the runner showed elevated I/O wait before and during the embedded-cluster stage. The available evidence does not establish the source of the runner's I/O stall or prove that this change prevents it.The concurrently running restore test used a fresh private cluster, yet performed six unchecked catalog-cleanup statements at setup and teardown. Remove that redundant work and the resulting unused helper; the two account drops required to exercise restore, all restore/permission assertions, and cluster close remain. In a small local ABBA comparison under 8 CPU/16 GiB caps, the restore root took 38.53/42.25 seconds on the baseline and 36.54/31.55 seconds with the cleanup removed. These are two samples per arm on local NVMe, not a guarantee for a loaded CI runner. The restore, shutdown, and EXCEPT ALL test roots passed in both normal and race modes before the final deletion of the now-unused helper. Incremental
static-check-selectedforpkg/tests/issues/isolatedpassed on the final source. The restore and EXCEPT ALL roots also passed a separate final-HEAD race rerun (34.60s and 9.83s, respectively).The failure artifact itself dropped the 1.2 MiB failed-test output because the raw report consumed the budget. Its reusable workflow lives in another repository; the independently tested fix is matrixorigin/CI#476.