Skip to content

[Bug]: concurrent morpc backend creation races on factory options #26562

Closed

Description

@gouhongshen

Is there an existing issue for the same bug?\n\n- [x] I have checked the existing issues.\n\n### Branch Name\n\nmain\n\n### Commit ID\n\n918846526e (first commit introducing parallel backend-create workers); observed in PR CI at head 00e2779\n\n### Other Environment Information\n\n- Hardware parameters: GitHub-hosted Ubuntu x86 runner\n- OS type: Ubuntu/x86\n- Others: Go race detector, MatrixOne ALL CI run 30697479476 attempt 1\n\n### Actual Behavior\n\nMatrixone CI / UT Test on Ubuntu/x86 fails in TestIssue26087ConcurrentDataBranchQuota with a data race.\n\nBoth conflicting writes are runtime.slicecopy calls from pkg/common/morpc.(*goettyBasedBackendFactory).Create at pkg/common/morpc/backend.go:1483. They run in two goroutines created by pkg/common/morpc.(*clientGCManager).ensureStartedLocked and executing runCreateLoop.\n\nThe factory uses:\n\n opts := append(bf.options, extraOptions...)\n\nWhen bf.options has spare capacity, concurrent Create calls reuse its backing array and write the appended extra options to the same elements. Commit 9188465 added multiple backend-create workers, making concurrent calls possible.\n\nFailed job: https://github.com/matrixorigin/matrixone/actions/runs/30697479476/job/91362714965\n\nThis failure was observed while validating PR #26559, whose diff only changes pkg/objectio/mergeutil and its tests/BVT; it does not change morpc or the client GC manager.\n\n### Expected Behavior\n\nConcurrent backend creation must not mutate or race on factory-owned option storage, and the race-enabled issue test must pass.\n\n### Steps to Reproduce\n\n1. Check out main containing commit 9188465.\n2. Run the Ubuntu/x86 unit-test suite with the race detector, including pkg/tests/issues.\n3. Observe TestIssue26087ConcurrentDataBranchQuota fail with concurrent writes at pkg/common/morpc/backend.go:1483.\n\nA focused morpc unit test should also call one factory concurrently with per-call extra options and verify it under the race detector.\n\n### Additional information\n\nOlder issue #11736 is a different resolved race between ByteBuf inspection and the backend read loop. Open refactoring #25691 concerns pipeline stream and TCP backend lifetime, not this shared options-slice race.

Activity

  1. self-assigned this
    on Aug 1, 2026
  2. added
    kind/bug
    on Aug 1, 2026
  3. gouhongshen commented on Aug 1, 2026

    @gouhongshen
    ContributorAuthor

    CI follow-up: workflow run 30697479476 attempt 2 was cancelled while setting up Go, before the Unit Testing step ran, after PR #26559 was rebased and pushed to a new head. Cancelled job: https://github.com/matrixorigin/matrixone/actions/runs/30697479476/job/91366332350. This attempt produced no repeated race result and will not be rerun again.

  4. gouhongshen commented on Aug 1, 2026

    @gouhongshen
    ContributorAuthor

    Repeated CI evidence on PR #26559 new head 1cb97c1: TestDataBranchPick failed under the race detector with two concurrent runtime.slicecopy writes from goettyBasedBackendFactory.Create at pkg/common/morpc/backend.go:1483, both launched by clientGCManager.runCreateLoop. Failed job: https://github.com/matrixorigin/matrixone/actions/runs/30699038757/job/91366710728. This is the same root cause as the original report, now reproduced in a second independent Data Branch test; pkg/tests/issues passed in this run.

  5. added
    severity/s0
    ai-easy
    and removed on Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ai-easykind/bugseverity/s0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions