Mysql
什麼是 MDL?(例如“MDL 語義”或“MDL 鎖”)可能與 Galera 相關
我發現一個人在 Galera/XtraDB 錯誤報告中談論MDL 語義。
什麼是 MDL?術語 MDL 也在 Galera 日誌
MDL conflict
中。請詳細說明。2018-06-14 17:07:10 140112699321088 [Note] WSREP: cluster conflict due to certification failure for threads: 2018-06-14 17:07:10 140112699321088 [Note] WSREP: Victim thread: 2018-06-14 17:07:10 140112690834176 [Note] WSREP: cluster conflict due to high priority abort for threads: 2018-06-14 17:07:10 140112690834176 [Note] WSREP: Winning thread: 2018-06-14 17:07:10 140112690834176 [Note] WSREP: Victim thread: 2018-06-14 17:07:10 140112690834176 [Note] WSREP: MDL conflict db=APC_MYSQLMON_DB table=TABLE1 ticket=4 solved by abort 2018-06-14 17:07:10 140112695683840 [Note] WSREP: MDL conflict db=APC_MYSQLMON_DB table=TABLE1 ticket=8 solved by abort 2018-06-14 17:07:10 140112695683840 [Note] WSREP: cluster conflict due to certification failure for threads: 2018-06-14 17:07:10 140112695683840 [Note] WSREP: Victim thread: 2018-06-14 17:26:47 140112698108672 [Note] WSREP: cluster conflict due to certification failure for threads: 2018-06-14 17:26:47 140112698108672 [Note] WSREP: Victim thread: 2018-06-14 17:34:48 140087340817152 [Note] WSREP: cluster conflict due to certification failure for threads: 2018-06-14 17:34:48 140087340817152 [Note] WSREP: Victim thread: 2018-06-14 17:36:48 140076554697472 [Note] WSREP: cluster conflict due to high priority abort for threads: 2018-06-14 17:36:48 140076554697472 [Note] WSREP: Winning thread: 2018-06-14 17:36:48 140076554697472 [Note] WSREP: Victim thread: 2018-06-14 17:36:48 140076554697472 [Note] WSREP: MDL conflict db=APC_MYSQLMON_DB table=TABLE1 ticket=4 solved by abort 2018-06-14 17:36:48 140087340817152 [Note] WSREP: MDL conflict db=APC_MYSQLMON_DB table=TABLE1 ticket=8 solved by abort 2018-06-14 17:36:48 140087340817152 [Note] WSREP: cluster conflict due to certification failure for threads: 2018-06-14 17:36:48 140087340817152 [Note] WSREP: Victim thread: 2018-06-14 17:37:50 139917573339904 [Note] WSREP: cluster conflict due to certification failure for threads: 2018-06-14 17:37:50 139917573339904 [Note] WSREP: Victim thread: 2018-06-14 17:05:12 139927950939904 [Warning] WSREP: Failed to report last committed 1941199495, -4 (Interrupted system call) 2018-06-14 17:09:41 139900840323840 [Note] WSREP: cluster conflict due to high priority abort for threads: 2018-06-14 17:09:41 139900840323840 [Note] WSREP: Winning thread: 2018-06-14 17:09:41 139900840323840 [Note] WSREP: Victim thread:
它代表“元數據鎖定”查看 MySQL https://dev.mysql.com/doc/dev/mysql-server/8.0.0/mdl_8h.html的來源
這是一種通過避免並發訪問相同數據來保持 ACID 數據庫的方法。這個想法是,當事務中的查詢使用該表時,表的元數據被“鎖定”。這樣做,將不允許另一個事務對這些鎖定的表執行 DDL 查詢。
例如,如果您在一個客戶端應用程序中執行
START TRANSACTION
然後SELECT * FROM t
,則表的元數據將t
被鎖定。沒有其他客戶端能夠執行此操作,ALTER TABLE t ...
因為它會在第一個客戶端事務仍然打開時弄亂表結構。MySQL 文件中的更多資訊https://dev.mysql.com/doc/refman/5.5/en/metadata-locking.html