Skip to content

[Bug]: AutoID restart test cleanup fails on final HAKeeper withdrawal connection reset #30372

Closed

Description

@iamlinjunhong

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Exact-case, cleanup/connection-reset, and final-withdrawal searches covered open and recently closed issues. Open #29712 concerns startup/SQL deadlines in this test, rather than a final-close HAKeeper reset. Closed #29044 describes a withdrawal error poisoning admission; admission is now successfully released in this occurrence. Neither establishes this exact current failure, so they are context rather than comparison proof. The separate shell cancellation failure is tracked in #30281.

Branch Name

codex/loom/develop/85fb92b036d31cc1e4db94af91471a957d47f888314ee4f9f05921905b9048f7

Commit ID

4f4ae26313d5e018a463c01b039be1843208fb66

Other Environment Information

Source PR: #30321
Exact head: 4f4ae26313d5e018a463c01b039be1843208fb66
Official-main control: b24d1b311555e0b6f3d56eb37f9a2e9617e9a5b7
Run 38845457042, attempt 1:

The original entry point is time make ut UT_CONFIGURED=1 UT_PARALLEL=6 UT_TIMEOUT=40 UT_SHARD=all, using Linux/x86_64, Go 1.27.1, CGo, race, short mode, and the matrixone_test tag on an 8 CPU / 16 GiB runner. Complete failed-job logs were read using gh run view --log-failed and the jobs' full logs. They identify two runtime failures; there is no compilation, type, static-analysis, security-gate, or recorded OOM failure.

Local controls use Darwin/arm64, Go 1.27.1, the same race/tag/short/CGo mode, and matching readonly native artifacts. They are not Linux/full-suite equivalence.

Actual Behavior

pkg/tests/issues/isolated/TestAutoIDCacheRestartAndDisabledNode completes its SQL/restart work but fails the final t.Cleanup assertion at auto_id_cache_restart_test.go:43:

cnservice/server_heartbeat.go:258 failed to publish final view metadata withdrawal
clean_handoff=false
writeto tcp4 127.0.0.1:<port>->127.0.0.1:10020: read: connection reset by peer
MO_UT_SETUP ... phase=service-close duration=15.103006675s status=error
MO_UT_SETUP ... phase=admission-release ... admission_released=true
auto_id_cache_restart_test.go:43: Received unexpected error: ... connection reset by peer
--- FAIL: TestAutoIDCacheRestartAndDisabledNode (153.48s)

The final-withdrawal error occurs at 04:23:47 UTC. Independent log-service task refresh reports resets to the same HAKeeper endpoint just before it; CN cluster refresh reports the identical socket error simultaneously. HAKeeper/Dragonboat timeouts occur throughout this test. Earlier restart withdrawals succeed. This identifies shared HAKeeper transport degradation but does not establish why the peer reset.

Expected Behavior

A healthy restart test should finish final cluster cleanup without returning a HAKeeper transport error. Cleanup must still drain local owners and release admission on error; that release succeeds in this occurrence. Preserve the assertions while investigating the transport/withdrawal lifecycle.

Steps to Reproduce

Focused control command, executed in three separate processes on each revision:

.agents/skills/mo-dev/scripts/mo-cgo-test -race -short -tags matrixone_test \
  -count=1 -timeout=10m -run '^TestAutoIDCacheRestartAndDisabledNode$' \
  -json ./pkg/tests/issues/isolated

For the clean-main snapshot, the wrapper's expanded environment/linker flags were used directly because an archive has no Git metadata. Native sources, module files and Makefile are identical between the two revisions, and the exact same native libraries/headers were used readonly. No native inputs were rebuilt or replaced.

The exact Linux reset has not been reproduced by these focused local commands; retain full-UT scheduling and HAKeeper client logs when investigating.

Additional information

Classification: non-PR flaky candidate under the bounded three-round comparison rule, not a claim that main reproduced the reset or that the defect is fixed.

All four attribution conditions were checked:

  1. Complete logs identify a runtime cleanup/socket-reset assertion; CI Required is downstream. No compile/type/static/security failure was present.
  2. Exact PR-head execution passed three consecutive independent processes, each naming the exact test and reaching terminal package PASS: 231.106s, 23.418s, 15.283s. The first round includes waiting behind another process's runner-wide cluster-admission lease; this is not a performance comparison.
  3. The complete PR diff changes only five pkg/lockservice files (waiter retry identity, complete range ledgers, conditional proxy unlock/handoff, and tests). AutoID SQL transitively uses lockservice, but the observed failing operation is outside those changed functions' causal closure: post-drain CN withdrawal calls SendCNHeartbeat through HAKeeper/MORPC before lockservice.Close. Changed functions neither own/reset that transport nor invoke withdrawal. The same endpoint fails for independent clients. No changes affect CN close ordering, HAKeeper, MORPC, this test, embed lifecycle, or the UT harness. Generic shared timing/resource influence remains a limitation; whole-test dependency independence is not claimed.
  4. Clean current official main ran the same selected test/mode in three separate processes, all PASS: 12.420s, 12.089s, 9.791s. To preserve the managed-lane restriction, main was exported with a complete git archive, without creating/switching another Git worktree. All 11,260 exported source files were hash-verified unchanged after execution. No PR lockservice code was present in that snapshot.

The exact-head UT diagnostics artifact contains complete pkg/lockservice terminal PASS (76.874s), 662 root-test passes, zero failures, and all seven new regression roots passing. The artifact's overall JSON is truncated, but these complete events are present and inspected. Shared build, SCA, UT Coverage, compose proxy BVT, and pessimistic multi-CN BVT also passed at this exact head.

The independent cancellation signature will be recorded in #30281 before requesting one failed-jobs rerun of run 38845457042. Any recurrence requires fresh attribution; no unrelated PR code is changed and no indefinite rerun loop is authorized.

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