Skip to content

fix: stabilize JoinMap, Compose, and authorization - #32558

Merged
XuPeng-SH merged 7 commits into
matrixorigin:4.2-devfrom
XuPeng-SH:fix/joinmap-cancel-identity
Nov 12, 2026
Merged

XuPeng-SH merged 7 commits into
matrixorigin:4.2-devfrom
XuPeng-SH:fix/joinmap-cancel-identity

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • BUG
  • Improvement
  • Test and CI

Which issue(s) this PR fixes

What this PR does / why we need it

  • Preserve the causal foreign-key error when sibling JoinMap cancellation propagates through local and remote execution.
  • Bundle and checksum-verify the pinned MinIO client in a separate Compose build stage, removing the release-download request that failed with HTTP 504.
  • Keep protected-database authorization on a causally valid statement snapshot. Wait for the current replay generation's applied watermark and certify cache reuse against the relevant catalog and policy dependencies. Serialize policy updates and check sequence, prepared-DDL, and nested execution before side effects.
  • Require every extracted table-scan source and target to satisfy its own privilege requirement. An ALL or ownership grant covers that object, rather than admitting the whole plan; view checks and definer/invoker handling still apply. This fixes an existing plan-authorization defect discovered while validating the rebased CTE planner. Users relying on the old table-ALL shortcut for a view need an explicit VIEW SELECT grant. Cold authorization misses can require additional catalog lookups; the warm path retains the existing cache certificate checks.
  • Check view chains even when a branch has no table scan, including constant views, and preserve tenant-scoped view identities. A system administrator reading a different account's historical view uses its own independently checked object privileges; an account administrator can read a legacy cross-account clone with a missing source owner. Valid local definers remain subject to their own grants, and local views over subscriptions retain subscriber authorization. Snapshot plans without account-qualified view metadata are rejected until rebuilt, and an ambiguous future cross-account view snapshot is rejected at binding.
  • Run first-replay and transaction-executor cluster UT packages in the serial race-test wave, and report a cluster-start error instead of masking it as a replay timeout. Increase the bounded overall phased UT budget from 60 to 90 minutes while retaining package timeouts and failure handling.

Validation

  • Go 1.26.4, Linux/amd64: complete frontend and plan packages and the affected explain-authorization integration test passed under race; the cross-CN inherited-role and prepared-authorization test passed under race on the earlier unchanged code. The CTE planner tests and the pkg/embed and partition tests that failed in the earlier CI run passed as separate race controls.
  • On the earlier rebased head, a private two-CN SQL test verified protected writes, prepared execution, source privilege revoke/regrant, and CTE and non-CTE reads with privilege caching enabled and disabled. The verified shared CTE plan has one producer and two sink readers.
  • Pessimistic/RC SQL BVT comparison: the new view/clone/snapshot/subscription case passed 201/201 twice, and the previously failing snapshot-restore case passed 289/289 on the preceding candidate. That candidate also passed the clone case 558/559 with one ignored and no failures; the subsequent production change only adds a malformed view-requirement cache guard. Other comparisons: plan privilege coverage 58/58, protected databases 193/193, scalar CTE 35/35, non-system views 65/65, nested view security 67/67. Existing result sets except the new privilege cases were compared without metadata checks.
  • On the earlier rebased head, a short single-client before/after comparison (two 40-sample runs per side, each sample includes a marker SELECT) measured cache-enabled two-table ALL queries at 0.369–0.376 ms vs 0.391–0.465 ms median; cache-disabled medians were 3.169–3.227 ms vs 5.452–6.098 ms. The earlier implementation could authorize the plan after checking just one object. These shared-host samples show the cold-path cost, not production throughput.
  • Full-delta gofmt, git diff --check, shell syntax, build and standard vet passed. Project molint reported no new diagnostics against the established baseline, and configured incremental golangci-lint reported 0 issues.
  • A deterministic peer-replay waiter test passed under race; earlier race runs covered disttae and first-replay, with 100 repetitions of selected replay and frontend concurrency tests. The pinned MinIO client SHA-256 was verified.

CI status and limits

  • Checks on the updated head are pending.

  • CI run 43208266333 on 4cb9415 passed the build, SCA, coverage producer, and Iceberg/Mongo connectors, but failed two snapshot-view and four clone-view reads, which the new local controls cover. Its phased race run hit the old 60-minute outer timeout during the heavy wave; the increased budget is not proof that a new run will pass. Coverage merge was blocked by missing profiles from the failed BVT producers.

  • On the earlier head 6eccd36775, Compose PROXY, pessimistic BVT, SCA, and UT coverage passed. Ubuntu/x86 race UT failed in shared embedded-cluster startup and a partition commit alongside Raft timeouts. Isolated local controls passed, but they do not reproduce CI's concurrent load or establish a root cause.

  • An existing CTE view over an account snapshot can fail with Unknown database; this is reproducible on the pre-change baseline and remains outside this fix.

  • The pinned MinIO binary reports vcs.modified=true; exact build-time source provenance remains unverified. The production Ubuntu base was unavailable locally, and the separate MinIO server image still downloads externally.

@XuPeng-SH
XuPeng-SH requested a review from aunjgr as a code owner November 11, 2026 13:57
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@mergify

mergify Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@matrix-meow matrix-meow added the size/M Denotes a PR that changes [100,499] lines label Nov 11, 2026
@XuPeng-SH

XuPeng-SH commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · done

Commit: f73a86280e4ee4c00e9be89507d572de9258713f

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: f73a86280e4ee4c00e9be89507d572de9258713f

Assessment: approve

Cancellation identity now reaches existing scope arbitration, allowing it to recover the causal execution error. Failed-build-only tree traversal preserves substantive errors and immutable broadcast snapshots without changing publication or cleanup ownership. No actionable findings remain.

Model: gpt-6.1-sol / max

Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0

Validation:

  • Reviewed all five changed files, build publication/consumption, scope cause arbitration and reset/free paths; assessed all three discussion keys and the unchanged FK BVT oracle.

  • Six focused message/hashjoin tests passed under race: checks/1794409714834530100-3.json; focused-race.stdout.log.

  • The full message package reported a terminal race PASS for 27 top-level tests. The combined command exited 124 before a hashjoin package result; it is not counted as an overall pass: checks/1794411119703418908-3.json.

  • Two internal probes each passed 100 race repetitions, covering causal FK/deadline/mixed-error handling and concurrent mutation isolation: checks/1794411194808796107-4.json and checks/1794411196447834036-98.json. Exact extracted functions and real frozen moerr inputs are documented in probe-inputs.json.

  • Isolation preflight, matching native prerequisites and final source/evidence audit passed; 171 native inputs verified. All 24 receipts and retained logs are reconciled in receipt-reconciliation.json and validation-report.json.

Limitations:

  • Full local normal/hashjoin race suites and committed-test stress attempts did not complete; no pass is claimed. Accepted focused VM execution, message package race completion and internal stress for the changed immutable payload and transparent forwarding; hashjoin adds no lifecycle or synchronization state.

  • No fresh SQL/BVT or full compile-package execution. Source-extracted probes are internal checks of copied frozen functions, not public SQL tests.

  • Frozen product CI is pending; raw author normal-suite/build/vet logs were unavailable. Warmup and environment-inspection receipts lacking source fingerprints are excluded from frozen-head execution proof.

@matrix-meow matrix-meow added size/XL Denotes a PR that changes [1000, 1999] lines and removed size/M Denotes a PR that changes [100,499] lines labels Nov 11, 2026
@XuPeng-SH XuPeng-SH changed the title [4.2-dev] fix(message): keep cancellation identity for failed JoinMap builds fix: preserve JoinMap errors and stabilize Compose setup Nov 11, 2026
@XuPeng-SH
XuPeng-SH marked this pull request as draft November 11, 2026 16:57
@XuPeng-SH
XuPeng-SH marked this pull request as ready for review November 11, 2026 16:58
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH
XuPeng-SH force-pushed the fix/joinmap-cancel-identity branch from 6eccd36 to 4cb9415 Compare November 12, 2026 11:20
@XuPeng-SH XuPeng-SH changed the title fix: stabilize JoinMap, Compose, and protected DB checks fix: stabilize JoinMap, Compose, and authorization Nov 12, 2026
@mergify mergify Bot added kind/bug Something isn't working kind/enhancement kind/test-ci labels Nov 12, 2026
@XuPeng-SH

XuPeng-SH commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · done

Commit: 4cb9415ef905cdb1825081b21906e19d33a6e7f3

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: 4cb9415ef905cdb1825081b21906e19d33a6e7f3

Assessment: approve

No actionable findings remain. JoinMap, authorization and logtail changes reuse existing owners; bounded policy certificates and table targets preserve general snapshot freshness and replay-generation checks. Per-object privilege coverage is enforced consistently, and the earlier revoked-write concern is resolved.

Model: gpt-6.1-sol / max

Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0

Validation:

  • Full race suites passed for frontend, message, disttae, logtail service and txnbase: 2,178 root passes and one existing skip.

  • Fifteen focused consumer tests, the SQL-helper interface control and the authenticated two-CN authorization regression passed.

  • Eight unit concurrency tests each passed 100 adaptive race repetitions. First replay passed with a runtime-only short-temp fixture and its separate adaptive repetition.

  • Preflight, native provenance, formatting, shell syntax, protobuf descriptor, pinned-client checksum and final receipt/source/log audits passed.

Limitations:

  • Product CI remains pending. Original FK failure timing, the older delayed-apply INSERT witness and full SQL/BVT suites were not rerun locally.

  • The unadapted first-replay run hit an overlong Unix socket path; successful runs change only its test fixture's runtime GOTMPDIR to private /tmp.

  • Full local hashjoin/dispatch/compile/TAE-db suites, exact Docker-base execution and vendor modified-source provenance were not independently verified.

@XuPeng-SH

XuPeng-SH commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · done

Commit: 92e9897b391a2c575f6f5da01180849087c345be

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: 92e9897b391a2c575f6f5da01180849087c345be

Assessment: approve

No actionable findings. The changes reuse existing error, authorization and logtail owners with bounded state. Tenant-scoped view checks preserve definer rules and cover views without table scans; the earlier authorization-snapshot concern remains resolved.

Model: gpt-6.1-sol / max

Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0

Validation:

  • Reviewed all 64 changed files, 16 discussion entries and three linked issues; discussion-assessment.json covers every key.

  • Local preflight, fresh native builds, formatting of 51 Go files, shell/protobuf/pinned-payload audits and 20-package selection passed. validation-summary.json reconciles receipts and retained logs, excluding unqualified source fingerprints.

  • Verified 53 changed paths are identical to the prior assessed head; assessed supplied same-PR owner-race, consumer and current SQL/BVT reports.

Limitations:

  • Local Go race/build/vet attempts timed out without terminal results; no local Go pass is claimed. Runtime coverage relies on supplied same-PR reports whose raw logs are unavailable here.

  • Frozen product CI remains pending. Public SQL/BVT and exact Docker-base execution were not rerun locally; mc modified-source provenance remains unverified.

This branch was successfully deployed

No deployments
ci — 175debc0 Deployed Nov 12, 2026 by XuPeng-SH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working kind/enhancement kind/test-ci size/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

3 participants