Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Transaction related DB errors attempt to rollback outside of a transaction and cause a fatal error

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

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
mariadb, php
Lĩnh vực
backend, databases

Hướng nghiên cứu

Bắt đầu trong Mysql.php, khoảng dòng 411, và lần theo cách xử lý onException được Queued Tracking sử dụng cho các lỗi cơ sở dữ liệu liên quan đến giao dịch. Kiểm tra cách trạng thái lỗi và rollback được kích hoạt, sau đó xác minh rằng các lỗi có thể thử lại như 1020 không gây ra rollback nghiêm trọng khi không còn giao dịch nào.

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

Mô tả

If an innodb_snapshot_isolation or similar transaction-related DB exception occurs during processing, Queued Tracking attempts to roll back but there's no transaction any more - the DB has already aborted the transaction, so this throws a fatal error and causes unwanted side effects such as site-wide cache destruction (https://github.com/matomo-org/matomo/issues/25000).

Starting to process request sets, this can take a while
Error query: Error query: SQLSTATE[HY000]: General error: 1020 Record has changed since last read in table 'matomo_log_visit'; try restarting transaction In query: UPDATE matomo_log_visit SET profilable = ?, visitor_seconds_since_order = ?, visit_exit_idaction_name = ?, visit_exit_idaction_url = ?,  visit_total_actions = visit_total_actions + 1 ,  visit_total_interactions = visit_total_interactions + 1 , visit_total_time = ? WHERE idsite = ? AND idvisit = ? Parameters: array (
  0 => 1,
  1 => NULL,
  2 => 200127,
  3 => 200128,
  4 => 952,
  5 => 1,
  6 => 1234653346,
) In query: UPDATE matomo_log_visit SET profilable = ?, visitor_seconds_since_order = ?, visit_exit_idaction_name = ?, visit_exit_idaction_url = ?,  visit_total_actions = visit_total_actions + 1 ,  visit_total_interactions = visit_total_interactions + 1 , visit_total_time = ? WHERE idsite = ? AND idvisit = ? Parameters: array (
  0 => 1,
  1 => NULL,
  2 => 200127,
  3 => 200128,
  4 => 952,
  5 => 1,
  6 => 1234653346,
)

In Mysql.php line 411:

  There is no active transaction

It would be good to add 1020 to onException so it at least gets retried (MariaDB LTS has innodb_snapshot_isolation on by default), but attempting to rollback outside of the transaction is still fatal - this is already the case with InnoDB deadlocks and other transaction related errors. I would suggest catching a rollback with no active transaction error and make it a no-op as the current logic always sets $this->hasError = true even if it's a retriable transaction error, so rollbacks are triggered regardless.

Ngôn ngữ chính
PHP
Star
87
Fork
41
Merge trung bình
3 ngày 17 giờ
Pull request đã merge (30 ngày)
5

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

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

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 matomo-org/plugin-QueuedTracking

Tất cả issue của matomo-org/plugin-QueuedTracking

Issue tương tự

Thêm issue về PHP

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.