[Bug] Cut-over may self-deadlock (Error 1205) behind Cloud Proxy / ProxySQL due to session-level lock visibility inconsistency

Đang mở
#1,659 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 10 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
42/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
go, mysql
Lĩnh vực
databases

Hướng nghiên cứu

Bắt đầu với việc điều phối khóa cut-over và xử lý phiên/kết nối của gh-ost, sau đó tái hiện Error 1205 thông qua proxy ProxySQL-like hoặc cloud khi không có lưu lượng. Xác định và kiểm thử chế độ cut-over một phiên tùy chọn, xác minh rằng thao tác đổi tên nguyên tử hoàn tất mà không bị timeout trong khi hành vi hiện tại vẫn không thay đổi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Environment

MySQL: 8.0+ (Cloud RDS: Tencent Cloud / Alibaba Cloud)
gh-ost: 1.0.49
Topology: MySQL accessed through cloud proxy / load balancer (e.g. ProxySQL-like architecture)
Description In a cloud-native deployment where MySQL is accessed via a proxy layer, gh-ost repeatedly fails during cut-over with:

Error 1205: Lock wait timeout exceeded

This occurs even under very low or zero application traffic, and with no observable long-running transactions.

Under the same zero-traffic conditions, a manual atomic RENAME TABLE old TO old_del, ghost TO old succeeds immediately.

Observed Behavior

gh-ost enters cut-over
lock orchestration retries/yields
eventually exits with lock wait timeout (1205)
Expected Behavior Cut-over should complete successfully under no-contention conditions, similar to the manual atomic RENAME TABLE.

Hypothesis / Possible Root Cause gh-ost cut-over uses multiple sessions (e.g. one session holding LOCK TABLES WRITE, another issuing RENAME TABLE).

When routed through a proxy, these sessions may not share lock state/ordering semantics exactly as expected (session split-brain / lock visibility inconsistency), causing the RENAME session to wait on locks effectively held by gh-ost’s own companion session.

This can look like a self-deadlock pattern and ends in timeout/yield.

Suggested Improvement Add an optional mode for proxy/cloud-RDS environments, e.g.:

--single-session-cut-over

that executes cut-over lock + atomic rename in a single session/connection, avoiding multi-session lock orchestration dependency.

Ngôn ngữ chính
Go
Star
13.6k
Fork
1.4k
Merge trung bình
9 ngày 19 giờ
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của github/gh-ost

Tất cả issue của github/gh-ost

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.