Skip to content

[Bug]: TestFailedBootstrap races on bootstrapCheckDeadline #28551

Closed

Description

@gouhongshen

Is there an existing issue for the same bug?

  • I have checked the existing issues; searches for TestFailedBootstrap, bootstrapCheckDeadline, and the reported source locations found no match.

Branch Name

main

Commit ID

81a6fc70e50d4ccc28d09b0d5e87f18a97a2ad9e

Other Environment Information

  • Hardware parameters: GitHub Actions Ubuntu x86 runner
  • OS type: Linux/amd64
  • Others: Go 1.26.4, -race, MatrixOne ALL CI

Actual Behavior

The Ubuntu UT race suite fails pkg/logservice.TestFailedBootstrap. The test goroutine writes store.bootstrapCheckDeadline directly while the background HAKeeper ticker reads the same field in checkBootstrapWithSetterAt, producing a deterministic Go race-detector failure for that execution.

WARNING: DATA RACE
Write at ...:
  github.com/matrixorigin/matrixone/pkg/logservice.testBootstrap.func1()
      pkg/logservice/store_hakeeper_check_test.go:1188
Previous read at ...:
  github.com/matrixorigin/matrixone/pkg/logservice.(*store).checkBootstrapWithSetterAt()
      pkg/logservice/store_hakeeper_check.go:522
--- FAIL: TestFailedBootstrap (0.25s)
    testing.go:1712: race detected during execution of test

Failing run: https://github.com/matrixorigin/matrixone/actions/runs/34396806225

Failing job: https://github.com/matrixorigin/matrixone/actions/runs/34396806225/job/102618684999

Expected Behavior

TestFailedBootstrap should force the bootstrap deadline through a synchronized test seam, or stop the background checker before mutating its state, so the package passes under -race without weakening the production synchronization contract.

Steps to Reproduce

  1. Check out 81a6fc70e50d4ccc28d09b0d5e87f18a97a2ad9e.
  2. Run the repository Ubuntu UT race selection containing pkg/logservice.TestFailedBootstrap.
  3. Observe the write/read race between store_hakeeper_check_test.go:1188 and store_hakeeper_check.go:522.

Additional information

Commit a43181b52d2cbade56a6a70c1c84ee8abb9671aa introduced both the elapsed-time bootstrap deadline and the direct test write. The failure is unrelated to PR #28272: that PR changes no pkg/logservice file, and its exact base and head contain identical logservice sources. The nearest clean fix should centralize deadline ownership/synchronization rather than adding a sleep, retry, nolint, or race exclusion.

Activity

  1. added
    kind/bug
    on Sep 9, 2026
  2. self-assigned this
    on Sep 9, 2026
  3. added
    severity/s0
    ai-easy
    and removed on Sep 9, 2026
  4. gouhongshen commented on Sep 9, 2026

    @gouhongshen
    ContributorAuthor

    PR #28553 is trying to fix this issue.

  5. gouhongshen commented on Sep 10, 2026

    @gouhongshen
    ContributorAuthor

    Resolved by merged PR #28554 at commit 1c28541e3c136342ac97cc8b0ce011aee2690945. That change routes testBootstrap through runManualHAKeeperStoreTest, which sets DisableWorkers=true before store construction. The production HAKeeper ticker therefore never starts for this manually driven fixture, giving the test exclusive ownership before it writes bootstrapCheckDeadline; the exact concurrent reader from the reported race is unreachable.

    PR #28272 has rebased onto this commit at head a9ad4a36c9e0de6d46e0a800d3518e207cc8e69f. On that exact head, .agents/skills/mo-dev/scripts/mo-cgo-test -race -count=100 -timeout=4m -run ^TestFailedBootstrap$ ./pkg/logservice passed in 21.742s. This closes the reported race without sleeps, retries, exclusions, or production changes.

  6. gouhongshen commented on Sep 10, 2026

    @gouhongshen
    ContributorAuthor

    PR #28553 has merged and is awaiting manual validation. The issue remains open.

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