Feature Request: Support session state tracking
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 2.5k
- Fork
- 443
- Merge trung bình
- 18 giờ 21 phút
- Pull request đã merge (30 ngày)
- 4
Mô tả
Note: I may be able to work on putting together a pull request for this feature request, but I wanted to make sure you were okay with this feature request and the approach I'm taking before doing all that work, hence I am filing this feature request for discussion and approval.
MySQL has a feature enabling server tracking of client session state changes. When this is enabled on the server and client, the server can actually notify the connected client about changes to its session state. This enables the client to, for example (our use case), determine which Global Transaction ID (GTID) or GTIDs were created when the client commits a transaction.
You can read more about this here:
- https://dev.mysql.com/doc/refman/5.7/en/session-state-tracking.html
- https://dev.mysql.com/doc/refman/5.7/en/mysql-session-track-get-first.html
- https://dev.mysql.com/doc/refman/5.7/en/mysql-session-track-get-next.html
Here's what is needed to support this:
- A new constant in
MySQLdb.constants.CLIENT:SESSION_TRACK = 1 << 23 - A new method on
_mysql.connectionnamedget_session_track_gtidswhich returns a list of GTIDs using C functionsmysql_session_track_get_first/mysql_session_track_get_nextand the enum valueSESSION_TRACK_GTIDS. - A new method on
_mysql.connectionnamedget_session_track_variableswhich returns a list of namedtuples containing the session variable names and values for changed variables using the same C functions and the enum valueSESSION_TRACK_SYSTEM_VARIABLES. - A new method on
_mysql.connectionnamedget_session_track_tx_characteristicswhich returns a list of strings of the characteristics that changed using the same C functions and the enum valueSESSION_TRACK_TRANSACTION_CHARACTERISTICS. - A new method on
_mysql.connectionnamedget_session_track_tx_statewhich returns a list of namedtuples containing information parsed from the data as described in the documentation forSESSION_TRACK_TRANSACTION_STATEusing the same C functions and the enum valueSESSION_TRACK_TRANSACTION_STATE.
The bare minimum that we need is items 1 and 2, but implementing also 3 through 5 would be more complete.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Start with MySQLdb.constants.CLIENT and the _mysql.connection API, then review the MySQL session-tracking documentation linked in the issue. Implementing the minimum means supporting SESSION_TRACK and get_session_track_gtids; completion for the broader request also includes the three variable, transaction-characteristic, and transaction-state methods with their documented return data.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- mysql, python
- Lĩnh vực
- database
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 42/100