Skip to content

[Bug]: Ubuntu UT job cascades across packages after cluster and checkpoint timeouts #26519

Closed

Description

@gouhongshen

Is there an existing issue for the same bug?

  • I searched matrixorigin/matrixone and matrixorigin/CI for waitAnyShardReadyLocked, base-cluster deadline failures, the observed checkpoint tests, and multi-test Ubuntu timeout failures; no matching issue was found.

Branch Name

main

Commit ID

0b8b53d

Other Environment Information

  • GitHub Actions workflow: MatrixOne ALL CI
  • Job: Matrixone CI / UT Test on Ubuntu/x86
  • Runner: Ubuntu 22.04 x86
  • PR head tested: 6961ff16d217e947618f43b92216c944f4559181

Actual Behavior

The Ubuntu UT job reported 20+ failures across unrelated ownership boundaries. The common symptoms include:

  • embedded-cluster tests failing during setup with context deadline exceeded / internal error: waitAnyShardReadyLocked;
  • HAKeeper heartbeats and proposals timing out, Dragonboat processing multiple delayed local ticks, and connections being reset;
  • TestHandleBackup timing out while forcing a checkpoint;
  • TestReadCheckpoint first observing an unexpected checkpoint count and then panicking after dereferencing a nil CheckpointEntry;
  • later authenticated-cluster tests failing after the shared service connection became unavailable.

The final failure list includes engine lease, TAE checkpoint, Iceberg, embed cluster, lock service, and data-branch tests:

TestCheckLeaseFailed, TestReadCheckpoint, TestHandleBackup,
TestIcebergSQLEngineEmbeddedSecurityErrors, TestRunSQLWithFrontend,
TestRowCountOverMySQLProtocol, TestBaseClusterCanWorkWithNewCluster,
TestCreateDB, TestBaseClusterOnlyStartOnce, TestClusterCanStartNewCNServices,
TestCommitWithLockTablesChanged, TestKeepRemoteLockPeerCursorIsFairAcrossSlowRounds,
TestIssue26111DataBranchDatabaseWithCyclicForeignKeys,
TestIssue26121DatabaseOperationsKeepOrdinaryInternalLookingTables,
TestIssue26087ConcurrentDataBranchQuota, ...

Failing job: https://github.com/matrixorigin/matrixone/actions/runs/30620241711/job/91122944038

This was observed while validating PR #26502, but that PR only changes pkg/logservice/snapshot.go and its focused unit test. The same CI job reports the entire pkg/logservice package as PASS (181.18s), including:

TestInitSnapshotMgrReplacesInMemoryView PASS
TestInitSnapshotMgr PASS
TestAddSnapshot PASS

Expected Behavior

The Ubuntu UT job should complete deterministically. A timeout or crash in one package/shared embedded cluster should not cascade into many unrelated test failures, and checkpoint tests should not panic after a failed prerequisite assertion.

Steps to Reproduce

  1. Run the full Ubuntu/x86 make ut workflow using the same package parallelism as MatrixOne ALL CI.
  2. Observe delayed Dragonboat ticks and HAKeeper heartbeat/proposal timeouts during concurrent package execution.
  3. Observe embedded-cluster initialization failing with waitAnyShardReadyLocked and subsequent tests failing immediately or losing their service connection.
  4. Inspect the final FAIL_UT_CASES summary and the TAE checkpoint panic.

Additional information

The run's SCA, BVT, and coverage jobs succeeded; the failure was isolated to the full Ubuntu UT job. Investigation should determine whether runner resource contention, shared embedded-cluster lifecycle, and checkpoint test cleanup/error handling each require separate follow-up fixes.

Activity

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

    @gouhongshen
    ContributorAuthor

    A second independent Ubuntu/x86 UT run shows the same embedded-cluster failure family on current main base 0b8b53dff3869dcd5e3ab52992852c9ea6545026 (tested PR head 1fd0b38f5c31b681acca920cd983b05779095b08):

    https://github.com/matrixorigin/matrixone/actions/runs/30623452935/job/91133128589

    New concrete evidence from this run:

    • TestBasicCluster timed out in waitAnyShardReadyLocked after HAKeeper propose tick failed: timeout and raft shard already closed.
    • TestTableFeatures lost HAKeeper while allocating an ID (127.0.0.1:12020: connection reset by peer).
    • TestPitrCases, TestAlterRoleCases, and TestCreateAndDropPitr failed to initialize the base cluster because multiple processes attempted the fixed gossip listener 0.0.0.0:11060 (bind: address already in use).
    • TestIcebergSQLEngineEmbeddedDeleteApply timed out creating its embedded tenant account.

    The same job also found a separate TAE transfer-page data race; that independent root cause is tracked in #26523 rather than folded into this cluster issue. TestInvalidTimestamp already has #26491.

  4. gouhongshen-gmail commented on Jul 31, 2026

    @gouhongshen-gmail

    The single permitted rerun also failed, confirming this is not an isolated first-attempt result.

    Attempt 2 failed in pkg/tests/shard, a different package/test surface from attempt 1, but with the same embedded-cluster symptoms:

    failed to get checker state: timeout
    failed to send tn/log service heartbeat: context deadline exceeded
    HAKeeper backend: broken pipe / backend connection closed
    wait TN ready timeout: context deadline exceeded
    internal error: waitAnyShardReadyLocked
    

    It also exposed a concrete cascade in pkg/tests/shard/shard_test.go: cluster startup fails inside sync.Once via require.NoError(t, new.Start()); the shared cluster is never assigned, but the Once is consumed. A subsequent test obtains the nil shareCluster and panics at c.GetCNService(0) (runShardClusterTestWithReuse, line 105 in this revision). Thus the job includes both the underlying embedded-cluster/HAKeeper instability and missing failure isolation in the shared test-cluster helper.

    Per the PR CI policy, run attempt 2 will not be rerun again. PR #26504 still has no code overlap with pkg/embed, pkg/tests/shard, HAKeeper, or shared test-cluster lifecycle code.

  5. XuPeng-SH commented on Aug 1, 2026

    @XuPeng-SH
    Contributor

    Latest-main audit on 2026-08-01:

    Conclusion: latest main contains a partial LogService shutdown improvement, but the broader Ubuntu/x86 embedded-cluster/checkpoint cascade is not demonstrated to be fully fixed. Keep this issue open until repeated full-UT validation covers the recorded failure surfaces.

  6. added a commit that references this issue on Aug 2, 2026
    ac4a306
  7. iamlinjunhong commented on Aug 13, 2026

    @iamlinjunhong
    Contributor

    Recurrence evidence from PR #27015 at exact head c375035.

    GitHub Actions run 31663302099, attempt 1, Ubuntu UT job 94332538173 failed in Unit Testing while running make ut UT_PARALLEL=6 UT_TIMEOUT=40. The only failing package and test was pkg/embed TestIcebergSQLEngineEmbeddedSecurityErrors after 20.11s. Stable signature: logservice and HAKeeper proposal/tick timeouts, followed by the loopback HAKeeper backend at 127.0.0.1:10020 returning broken pipe and connection reset by peer while the test created a database.

    The exact focused test passed deterministically at the PR head with the repository mo-dev runner:
    .agents/skills/mo-dev/scripts/mo-cgo-test -v -count=1 -timeout=240s ./pkg/embed -run ^TestIcebergSQLEngineEmbeddedSecurityErrors$
    Result: PASS in 13.00s, package completed in 14.749s.

    This matches the clean-main failure family already documented in this issue, including this exact test and the same HAKeeper timeout and loopback reset signature. Adding this run as recurrence evidence only; no lifecycle or label change requested.

    Run: https://github.com/matrixorigin/matrixone/actions/runs/31663302099
    Job: https://github.com/matrixorigin/matrixone/actions/runs/31663302099/job/94332538173

  8. iamlinjunhong commented on Aug 14, 2026

    @iamlinjunhong
    Contributor

    Recurrence evidence from PR #27021 at exact head bed4f35dc8d3b27940828c6de94e76c8cd1df270.

    GitHub Actions run 31766778440, attempt 1, Ubuntu/x86 UT job 94664225093 failed in step Unit Testing while running:

    make clean && time make config
    time make ut UT_PARALLEL=6 UT_TIMEOUT=40
    

    The only failed package/test was pkg/embed.TestRowCountOverMySQLProtocol. Stable signature:

    create table t (id int primary key)
    Error 1105 (HY000): ... 127.0.0.1:10020 ... connection reset by peer
    --- FAIL: TestRowCountOverMySQLProtocol (17.69s)
    

    Immediately before the reset, the same embedded cluster logged LogService/HAKeeper proposal and checker-state timeouts, heartbeat deadline failures across all three CNs, TN commit latency of 3-7 seconds, and Dragonboat had 10 LocalTick msgs in one batch. This matches the load-sensitive embedded-cluster/control-plane failure family already recorded here. The same workflow head passed the separate Ubuntu/x86 coverage UT job.

    Deterministic focused checks using the repository mo-dev CGo contract both passed:

    PR head bed4f35dc8d3b27940828c6de94e76c8cd1df270:
    TestRowCountOverMySQLProtocol PASS (10.78s), package 11.859s
    
    clean current main 263567cf1a56da904788bc6d1d613ff19cb44783:
    TestRowCountOverMySQLProtocol PASS (11.72s), package 12.856s
    

    Both used -short -v -count=1 -timeout 5m -run ^TestRowCountOverMySQLProtocol$ ./pkg/embed with the same Go 1.26.4 toolchain and native artifacts. PR #27021 changes only the OFFSET parser/planner path and its regression cases; it does not modify pkg/embed, LogService, HAKeeper, TN/CN heartbeat, or their lifecycle.

    Run: https://github.com/matrixorigin/matrixone/actions/runs/31766778440
    Job: https://github.com/matrixorigin/matrixone/actions/runs/31766778440/job/94664225093
    PR: #27021

    Adding recurrence evidence only; no lifecycle or label change requested. A single failed-job rerun will be requested under the PR CI policy.

  9. gouhongshen commented on Aug 14, 2026

    @gouhongshen
    ContributorAuthor

    Current-main recurrence from PR #27154 at exact head 9cf70871568445211d1d5e094f92f9c85eef193a and base 11981033c588d3fe7e6fcc50ead874dfcd88d8f8.

    Workflow 31795529089 attempt 1, Ubuntu/x86 UT job 94751807916, failed in the two surfaces already covered by this issue:

    • pkg/vm/engine/tae/db/test.Test_CheckpointChaos2: forced GCKP first timed out (DB-Force-GCKP ... context deadline exceeded). A later fresh checkpoint completed, after which the test observed different checkpoint timestamps and 5 entries instead of 3 at db_test.go:9786, :9801, and :9830.
    • pkg/embed.TestRowCountOverMySQLProtocol: LogService/HAKeeper on 127.0.0.1:10020 timed out and reset the connection while create table t ran; cluster_test.go:298 received Error 1105 ... connection reset by peer.

    PR #27154 changes only clone allocator reconstruction and clone tests/results (pkg/sql/compile/operator.go plus focused clone UT/BVT files). It has no overlap with pkg/embed, LogService/HAKeeper, or TAE checkpoint code. The focused clone tests and the separate coverage UT producer passed. This is therefore recurrence evidence for the existing load-sensitive full-UT failure family, not a PR-caused regression.

    The same workflow's PROXY BVT failure is independently tracked by #27164; its Coverage failure is derivative of the failed BVT producer.

  10. 18 remaining items

  11. gouhongshen commented on Aug 29, 2026

    @gouhongshen
    ContributorAuthor

    Current-head recurrence observed while validating PR #27830 on exact head 6fb0573b9d4b4ced0a0339e01cabec2a7e94f53c.

    The test failed before reaching its subscription-privilege assertions. restore cluster{snapshot='issue_26640_cluster_snapshot'} returned Error 20709 (HY000): remote lock wait timeout after a two-minute remote_lock_owner_timeout. The surrounding job log shows the shared embedded-cluster control-plane/lockservice path timing out during restore; the test then failed at issue_26640_test.go:335. This is the same load-sensitive Ubuntu UT control-plane failure family already recorded here, including earlier recurrences in the issue-26640 test family.

    The failed job reported zero build failures. PR #27830 changes only pkg/fileservice/disk_cache_lifecycle_test.go and does not modify restore, embedded-cluster lifecycle, LogService/HAKeeper, lockservice, or the issue-26640 test. The rerun is attempt 2, so no further workflow rerun is being requested.

  12. XuPeng-SH commented on Sep 9, 2026

    @XuPeng-SH
    Contributor

    New recurrence evidence from PR #28443:

    A narrower follow-up tracker was opened for the client retry boundary: #28452. This issue remains the broader embedded-cluster/runner lifecycle family; the deeper first fault (Dragonboat scheduling/WAL pressure versus transport) is still not proven.

  13. added 9 commits that reference this issue on Sep 17, 2026
    2ff0bf5
    20debc9
    e5d1be6
    ec0dba1
    5f85455
    dd38f00
    4a028a2
    df33c5f
    30df8ec
  14. gouhongshen commented on Nov 11, 2026

    @gouhongshen
    ContributorAuthor

    Reproduced again in MatrixOne ALL CI workflow run 43077626773 (attempt 1), job Matrixone CI execution / UT Test on Ubuntu/x86 (job log), while validating PR #32438 (head 7943d72fb63f151359c1e5b50611cd1880a2dbbe, target 4.2-dev) on 2026-11-11 18:25–19:19 UTC:

    TestCheckpointTableIDBatch2 (pkg/vm/engine/tae/db/test) failed at db_test.go:14391 with context deadline exceeded when the forced incremental checkpoint missed its schedule budget:

    ICKP-Schedule-Force-End {"ts":"1794423261400976125-0","cost":"14.999941008s",...,"error":"context deadline exceeded"}
    ICKP-Control-Force-End {"error":"context deadline exceeded","total-cost":"20.001557531s","flush-cost":"5.001121555s"}
    

    The runner was under visible memory throttling (Merge: limit=12GiB, total=251.5GiB, available=10.71GiB, cgroup=16GiB) and the same run's table-tail flushes took ~4.6s each (vs ~69ms for the light table), so the 15s ICKP schedule deadline expired while flushes were still draining — the checkpoint-timeout-under-load cascade pattern tracked in this issue. Three other embedded-cluster/engine UTs (TestDropJobsByDBName, TestCreateAndDropPitr, TestShowAccountsStorageAggregation) failed in the same job with the corresponding ISCP-watermark/HAKeeper-reset symptoms.

    Why this is unrelated to PR #32438: that PR changes only pkg/sql parsing/plan/function code and BVT fixtures; the failing test is a TAE checkpoint test in packages it does not touch, and in this very run pkg/sql/plan was green (ok ... 2.959s). The same UT job passed entirely on the previous head 8dacb3faa7 earlier the same day (attempt 2 of run 43041162542, job 130632540702).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

deferredkind/bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions