Skip to content

[Bug]: embedded UT restore deadlocks with view-metadata heartbeat #28742

Closed

Description

@XuPeng-SH

Problem

The Ubuntu/x86 UT coverage job failed in TestIssue26640ClusterRestoreRebindsSubscriptionPrivileges while executing:

restore cluster{snapshot='issue_26640_cluster_snapshot'}

The server returned Error 20701 (HY000): deadlock detected. The lock service recorded a cycle between the restore transaction and the CN view-metadata admission heartbeat.

Evidence

This is the same lock-order class described in #28317 and has been observed in the existing restore UT history (#27120).

Impact

Unrelated restore and view-metadata activity can fail a required UT job with a real catalog deadlock. A rerun may pass because the cycle depends on scheduling, but retrying does not fix the lock-order inversion.

Expected behavior

Use one consistent coordination order for restore, view-metadata admission, and SNAPSHOT lifecycle operations so the supported restore flow cannot form this cycle. Add a deterministic two-CN regression that exercises the concurrent heartbeat/restore path and verifies recovery and cleanup.

Scope

  • Identify and fix the shared catalog lock-order inversion.
  • Preserve restore atomicity and view-metadata consistency.
  • Keep the regression deterministic and bounded.
  • Do not mask the issue with broad retries or by weakening the UT.

Related: #28317

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

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions