You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: embedded UT restore deadlocks with view-metadata heartbeat #28742
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.
The failure happened in test execution; diagnostic and artifact uploads completed successfully.
The restore path holds the SNAPSHOT lifecycle gate while changing catalog view metadata.
The heartbeat path reaches the view-metadata gate while waiting on the SNAPSHOT lifecycle gate.
Cleanup messages after the deadlock are secondary effects.
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.
Activity
fix(snapshot): order restore catalog locks (#28743)
fix(snapshot): order restore catalog locks (matrixorigin#28743)
fix(snapshot): order restore catalog locks (matrixorigin#28743)
fix(snapshot): order restore catalog locks (matrixorigin#28743)
Optimize wide scans for MARK joins under OR (#32607)