Skip to content

[Bug]: pkg/embed cluster startup repeatedly times out after delayed HAKeeper Raft ticks #26544

Closed

Description

@XuPeng-SH

Is there an existing issue for the same bug?

Branch Name

main

Commit ID

  • Tested PR head: 939a675096f0cc9283a28bfd08304d9baecaf462
  • Main parent merged into the tested head: e1a11841ec96c7fba3870dfa67ef86a6fb75533f
  • Latest-main audit: 3e9ad81b9a13732305b168e0f443fd76cca62a81

Other Environment Information

Actual Behavior

Both permitted Ubuntu/x86 UT attempts failed during pkg/embed cluster startup with the same control-plane signature, although they failed in different tests:

The attempt-2 log exposes the startup failure chain:

  1. The single-node HAKeeper Raft group repeatedly reports dropped proposal, no leader.
  2. After leader election, initial-cluster-info proposals, HAKeeper ticks, checker-state reads, and LogService/TN heartbeats continue to time out.
  3. Dragonboat reports batches of 13–17 delayed LocalTick messages.
  4. All three CN services remain at shard not ready.
  5. Cluster startup exhausts its deadline and TestBasicCluster fails at pkg/embed/cluster_test.go:93.

Representative log sequence:

dropped proposal, no leader
failed to propose initial cluster info: timeout
propose tick failed: timeout
had 13 LocalTick msgs in one batch
had 17 LocalTick msgs in one batch
failed to get checker state: timeout
failed to send tn heartbeat: timeout
shard not ready
wait TN ready timeout: context deadline exceeded
internal error: waitAnyShardReadyLocked

PR #26501 changes recursive CTE planning/execution and has no code overlap with pkg/embed, LogService, HAKeeper Raft startup, or TN shard readiness.

Expected Behavior

A single-node embedded HAKeeper cluster should elect its leader, initialize cluster state, process ticks and heartbeats, and make the TN shard ready within the bounded startup period under the normal Ubuntu/x86 full-UT load profile.

The same workflow rerun should not move from TestMultiClusterCanWork to TestBasicCluster while failing with the identical startup timeout.

Steps to Reproduce

  1. Use commit e1a11841ec96c7fba3870dfa67ef86a6fb75533f or a descendant.
  2. Run the normal MatrixOne Ubuntu/x86 full unit-test workflow with its existing package parallelism on an 8-core/16-GB runner.
  3. Observe pkg/embed cluster startup while other packages run concurrently.
  4. Check for delayed Dragonboat LocalTick batches, proposal/checker-state/heartbeat timeouts, CN shard not ready, and the final waitAnyShardReadyLocked timeout.
  5. Rerun the workflow once; the failure may surface in a different embedded-cluster test with the same signature.

Analysis

The immediate assertion is only the final symptom. The first actionable signal is the HAKeeper Raft event loop falling behind during startup:

  • a 100 ms HAKeeper tick interval accumulates into batches of 13–17 local ticks;
  • startup proposals time out before and after leader election;
  • checker-state and heartbeat requests then fail;
  • TN readiness never converges before the cluster-level deadline.

The two consecutive workflow attempts make this stronger than a single isolated flaky result.

The tested base already contains #26507. That PR joins the HAKeeper task-scheduler goroutine before NodeHost.Close, addressing a shutdown race; it does not prevent this startup failure.

Latest-main audit:

Therefore current main has no demonstrated fix for this narrower startup failure.

Additional information

Related reports:

This issue intentionally focuses on the repeatable pkg/embed HAKeeper/Raft startup path so that fixes and repeated validation can be evaluated independently of those other failure families.

Activity

  1. added
    kind/bug
    on Aug 1, 2026
  2. self-assigned this
    on Aug 1, 2026
  3. added a commit that references this issue on Aug 2, 2026
    ac4a306
  4. gouhongshen commented on Aug 2, 2026

    @gouhongshen
    Contributor

    A post-#26546 recurrence occurred in PR #26580's Ubuntu/x86 UT job.

    The log shows the same signature tracked here: HAKeeper/LogService schedule, checker, and heartbeat timeouts; Dragonboat delayed LocalTick batches (11, then 6); all three CNs remaining shard not ready; and final TN-ready timeouts.

    PR #26580 changes only DATA BRANCH generated-column handling and its frontend/BVT tests. It has no overlap with pkg/embed, HAKeeper, LogService, or cluster startup. Its focused frontend tests and DATA BRANCH BVT passed locally, while the other current CI BVT, SCA, and coverage jobs passed.

    Because this recurrence is on a base containing the fix that closed #26544, it is evidence that the startup failure is not fully eliminated.

  5. added 3 commits that reference this issue on Sep 17, 2026
    2ff0bf5
    ec0dba1
    4a028a2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions