Skip to content

[Bug]: CI intermittently rejects a freshly regranted role before account restore #32327

Closed

Description

@ck89119

Is there an existing issue for the same bug?

Branch Name

4.2-dev, observed in PR #32232 (issue-32214-4.2-dev).

Commit ID

f7364230dbc7f1714dda03a78bee923a5c77e9cd; comparison base 02fcfbc898f595b4f8eeb3545c6970e6d3711e85.

Other Environment Information

Actual Behavior

The UT job's only reported failing leaf is:

TestIssue29399AuthorizationScopeAndRevokedRole/account_restore_removes_current_membership
pkg/tests/issues/issue_29399_test.go:523
Error 20101 (HY000): internal error: do not have privilege: active role is no longer granted to the user

This assertion is before RESTORE ACCOUNT: the test revokes reader from u, creates an account snapshot, grants reader back through CN0, then immediately re-executes an existing binary prepared SELECT through CN1. The SELECT unexpectedly reports that the active role is no longer granted. The failure was emitted at 2026-11-06 04:33:53 UTC; the job collected its report at 04:44:12 UTC.

This is an unresolved cross-CN role-visibility/authorization assertion, not a coverage threshold, compiler, lint, timeout, or established infrastructure failure. The surrounding transfer-page cross-device-rename warnings have not been shown to cause this assertion.

Expected Behavior

After the role grant is committed and visible to the consuming CN, the prepared SELECT succeeds. After account restore removes that membership, the same prepared SELECT is denied; its later re-grant control succeeds. If visibility synchronization is part of the test contract, use an observable commit barrier rather than weakening authorization assertions or adding sleeps.

Steps to Reproduce

Run the linked Linux UT job or focus this exact subtest in the repository's matching CGo environment:

GOTOOLCHAIN=go1.26.4 .agents/skills/mo-dev/scripts/mo-cgo-test \
  -short -tags matrixone_test -race -count=1 -timeout=5m \
  -run '^TestIssue29399AuthorizationScopeAndRevokedRole$/^account_restore_removes_current_membership$' \
  ./pkg/tests/issues

The failure is intermittent/not yet locally reproduced. The parent test setup creates the two-CN account/roles and retained prepared statement; running only arbitrary statements without that setup is not equivalent.

Additional information

The CDC PR changes only CDC error classification, target execution/recovery, batch ownership counts, and CDC pipeline-admission error persistence. The failing authorization/restore implementation and test are unchanged; this test does not create a CDC task. No causal path from the changed CDC functions to this role-grant/SELECT boundary has been identified. This is tracked independently instead of changing unrelated security logic in the CDC PR.

Initial local normal-mode comparisons both passed: the exact candidate and an overlay replacing all six production files changed by the PR with the verified base's contents. Test source, Go toolchain, and native inputs were unchanged in that comparison. These passes are not proof that the CI failure is pre-existing or fixed; the same failing signature has not been reproduced on the baseline.

Matching local -short -tags matrixone_test -race comparisons also passed (candidate package 60.708s; base-production overlay package 24.476s), with the named leaf selected and no failed tests in either run. The base overlay removes every PR production hunk; package-local CDC/frontend/embed test additions are not compiled as dependency tests. This is a source-isolated comparison, not a full clean-baseline Linux CI reproduction.

The same failure has not been reproduced on the baseline, so a pre-existing defect is not proven. There is no established CDC causal path and no justification to weaken or modify this security assertion in the CDC PR. Track this independent CI failure candidate here and request one rerun of the failed UT job; preserve a repeated failure signature rather than rerunning indefinitely.

Metadata

Metadata

Assignees

Labels

kind/bugneeds-triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions