Mysql
為什麼我在 SHOW FULL PROCESSLIST 中只看到 COMMIT 或 commit - 沒有 SQL 語句
我在很多輸出中
SHOW FULL PROCESSLIST
只看到了COMMIT
orcommit
(小寫和大寫混合)。這些交易是什麼?為什麼沒有 SQL 語句?我們正在執行 MariaDB 10.1.x 和 Galera 複製(3 個節點)。如何解釋這些交易?
> select COMMAND,TIME,STATE,INFO,TIME_MS,STAGE,MAX_STAGE,PROGRESS,MEMORY_USED,EXAMINED_ROWS,QUERY_ID,INFO_BINARY,TID from INFORMATION_SCHEMA.PROCESSLIST where INFO like '%commit%'; +---------+------+----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+-------+-----------+----------+-------------+---------------+-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+ | COMMAND | TIME | STATE | INFO | TIME_MS | STAGE | MAX_STAGE | PROGRESS | MEMORY_USED | EXAMINED_ROWS | QUERY_ID | INFO_BINARY | TID | +---------+------+----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+-------+-----------+----------+-------------+---------------+-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+ | Query | 1 | init | COMMIT | 1267.015 | 0 | 0 | 0.000 | 67544 | 0 | 483610134 | COMMIT | 12241 | | Query | 112 | init | COMMIT | 112442.763 | 0 | 0 | 0.000 | 67544 | 0 | 483594429 | COMMIT | 12003 | | Query | 151 | init | COMMIT | 151914.251 | 0 | 0 | 0.000 | 67544 | 0 | 483588122 | COMMIT | 11972 | | Query | 156 | init | COMMIT | 156962.716 | 0 | 0 | 0.000 | 141368 | 0 | 483587455 | COMMIT | 11962 | | Query | 156 | init | COMMIT | 156961.757 | 0 | 0 | 0.000 | 141368 | 0 | 483587456 | COMMIT | 11960 | | Query | 182 | init | commit | 182230.206 | 0 | 0 | 0.000 | 67544 | 0 | 483584325 | commit | 11801 | | Query | 229 | init | COMMIT | 229144.061 | 0 | 0 | 0.000 | 67544 | 0 | 483578193 | COMMIT | 11529 | | Query | 0 | Filling schema table | select COMMAND,TIME,STATE,INFO,TIME_MS,STAGE,MAX_STAGE,PROGRESS,MEMORY_USED,EXAMINED_ROWS,QUERY_ID,INFO_BINARY,TID from INFORMATION_SCHEMA.PROCESSLIST where INFO like '%commit%' | 0.346 | 0 | 0 | 0.000 | 104808 | 0 | 483610236 | select COMMAND,TIME,STATE,INFO,TIME_MS,STAGE,MAX_STAGE,PROGRESS,MEMORY_USED,EXAMINED_ROWS,QUERY_ID,INFO_BINARY,TID from INFORMATION_SCHEMA.PROCESSLIST where INFO like '%commit%' | 11359 | | Query | 66 | init | commit | 66835.790 | 0 | 0 | 0.000 | 67544 | 0 | 483601099 | commit | 10917 | | Query | 353 | init | commit | 353104.108 | 0 | 0 | 0.000 | 67544 | 0 | 483561401 | commit | 10807 | | Query | 494 | init | COMMIT | 494696.772 | 0 | 0 | 0.000 | 338232 | 0 | 483540392 | COMMIT | 9997 |
COMMIT TRANSACTION
如果在顯式事務期間已寫入/更新數據,則在從日誌文件複製數據的最後一條語句之前,它可能根本不會寫入數據文件。這使得在伺服器崩潰後重新啟動時出現錯誤後回滾是一個顯式ROLLBACK TRANSACTION
語句,這是一個非常快速的操作,因為它只需將相關的日誌條目標記為無效。如果在該事務期間添加或更改了大量數據,這可能需要一些時間。
為什麼沒有 SQL 語句?
在這種情況下
COMMIT TRANSACTION
,或一些有效的縮寫,是這些會話的目前 SQL 語句。