Skip to content

[Bug] HAKeeper client leaks transient backend closure into embedded UT SQL #28452

Closed

Description

@XuPeng-SH

Summary

TestIssue26640CrossAccountRestoreRebindsPrivileges failed in PR #28443 before reaching any restore or privilege assertion. The failure is a recurrence of the embedded-cluster control-plane failure family, not a regression in the PR's QUOTE() change.

The exact failure was recorded in:

Evidence

At 2026-09-08 21:15:47 UTC, the embedded LogService reported a HAKeeper checker timeout and Dragonboat reported delayed LocalTick messages. About 540 ms later, the HAKeeper client returned backend connection closed while allocating an ID. The same connection failure then reached CN heartbeat, background catalog work, and the foreground CREATE ACCOUNT statement:

failed to get checker state: timeout
[00000:31072] had 7 LocalTick msgs in one batch
failed to allocate id: backend connection closed
failed to send cn heartbeat: backend connection closed
create account `issue_26640_target` ...: backend connection closed

The test failed during setup at issue_26640_test.go:58; it never executed the restore assertions. The job also recorded later HAKeeper checker/proposal timeouts and 1–2 second WAL/commit latency.

Proven and unknown causes

Proven:

  • the observed SQL error is a downstream control-plane transport failure;
  • managedHAKeeperClient resets a failed client generation but treats ErrBackendClosed as non-retryable, unlike EOF/UnexpectedEOF;
  • the caller therefore receives one transient transport error immediately instead of using the existing bounded retry budget.

Not proven by this run:

Expected behavior

A transient HAKeeper backend closure should invalidate that generation and retry through a replacement connection until the caller's existing deadline expires. A permanent checker/raft outage must still return a bounded, actionable error; this issue does not propose retrying SQL or hiding an unhealthy cluster.

Related

Activity

  1. added
    kind/bug
    on Sep 9, 2026
  2. self-assigned this
    on Sep 9, 2026
  3. XuPeng-SH commented on Sep 9, 2026

    @XuPeng-SH
    ContributorAuthor

    Implemented in PR #28453: #28453. The patch retries bounded HAKeeper transport-generation failures and makes managed-client shutdown terminal so late failures cannot recreate a closed transport. It also adds deterministic retry, deadline, in-flight close, and concurrent close tests.

  4. added a commit that references this issue on Sep 9, 2026
    363f8c3
  5. added 3 commits that reference this issue on Sep 17, 2026
    38b9880
    69bdaa1
    e1c61de
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