Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
Branch Name
4.2-dev
Commit ID
CI tested 23341d016648cab40db408fc87e9e362867baac4 against 6a905c7e660a71597ff1eb9fc61907145584377b. The restart fixture and the disttae shard check are identical on both revisions.
Other Environment Information
Ubuntu linux/amd64, Go 1.26.4, -race -short -tags matrixone_test. The fixture owns an embedded cluster with three CNs. UT job and case diagnostics
Actual Behavior
On December 2, 2026, the case restarted the cluster and verified the cloned rows successfully. The startup checks for all three CNs logged a ready shard at 04:21:18 UTC. At 04:21:23 UTC the first write in the next explicit transaction failed on CN 0:
insert into clone_tail_source.heap values ('prior transaction write');The client received Error 20506 (HY000): service unavailable: TN 10002-tn has no reported shard. The next DATA BRANCH CREATE DATABASE statement did not run. Independently, cron-task writes from other CN sessions reported the same TN error. Cleanup then attempted DROP SNAPSHOT while the failed test session still had an open transaction and received error 20101. Test and cleanup
Expected Behavior
After the fixture reports that the restarted cluster is ready, its CN should be able to execute the first transactional write. The test should reach the branch creation and verify rollback.
Steps to Reproduce
- Build the native dependencies on
4.2-devand use its Go 1.26.4 toolchain. - Run
.agents/skills/mo-dev/scripts/mo-cgo-test -short -race -tags matrixone_test -count=1 -run '^TestDataBranchDatabaseMutableTail$' ./pkg/embed. - Inspect the first write after the restart and compare the shard list used for precommit with the HAKeeper response seen by the startup check. The CI failure was intermittent.
Additional information
The error is raised when the write set is nonempty and the selected TN service carries no shards. The logs do not identify which heartbeat or refresh produced that view. The base already contains a deterministic test for the empty-shard write guard. Write guard · Base test
On a clean checkout of 6a905c7e66 with Go 1.26.4 on Darwin/arm64, the full restart case passed once under -race -short -tags matrixone_test. The base test TestGenWriteReqsRequiresReportedTNShardForWrites also passed and confirmed that a nonempty write with the selected TN's shard list cleared returns the same service-unavailable error. This local run did not reproduce the timing of the CI failure.
Activity
[4.2-dev] Stabilize lock and clone race tests (#33685)