91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

MySQL5.6 + xtrabackup 死鎖,Waiting for Commit Lock

發布時間:2020-08-07 10:22:32 來源:ITPUB博客 閱讀:252 作者:G8bao7 欄目:MySQL數據庫

http://www.ttlsa.com/mysql/mysql5-6-waiting-for-commit-lock/
http://bugs.mysql.com/bug.php?id=70307

MySQL5.6 + xtrabackup 死鎖,Waiting for Commit Lock

使用MySQL5.6和Xtrabackup的小心一個bug,http://bugs.mysql.com/bug.php?id=70307,這個bug在5.6.23中已經修復。

Xtrabackup備份的時候執行flushs tables with read lock和show slave status會有可能和SQL Thread形成死鎖,導致SQL Thread一直被卡主,STOP也沒有用,Kill我們測試會丟失數據,只有Restart Server才行。
原因是SQL Thread的DML操作完成之后,持有rli->data_lock鎖,commit的時候等待MDL_COMMIT,而flush tables with read lock之后執行的show slave status會等待rli->data_lock;修復方法是rli->data_lock鎖周期只在DML操作期間持有。

重現步驟:

一、創建表
CREATE TABLE test (
  id int(10) NOT NULL AUTO_INCREMENT,
  age int(11) DEFAULT '0',
  PRIMARY KEY (id),
  KEY idx_age (age)

) ENGINE=InnoDB

二、master上執行update test set value=sleep(20)+53 where id=1;(增加sleep(20)是為了模擬方便,所以需要是statement的binlog format,row格式不行)
三、等同步到slave,并且正在執行時;執行flush tables with read lock;show slave status;就會阻塞住。

官方詳細的解釋和說明:

Bug#19843808: DEADLOCK ON FLUSH TABLES WITH READ LOCK + SHOW SLAVE STATUS Problem: If a client thread on an slave does FLUSH TABLES WITH READ LOCK; then master does some updates, SHOW SLAVE STATUS in the same client will be blocked. Analysis: Execute FLUSH TABLES WITH READ LOCK on slave and at the same time execute a DML on the master. Then the DML should be made to stop at a state "Waiting for commit lock". This state means that sql thread is holding rli->data_lock and waiting for MDL_COMMIT lock. Now in the same client session where FLUSH TABLES WITH READ LOCK was executed issue SHOW SLAVE STATUS command. This command will be blocked waiting for rli->data_lock causing a dead lock. Once this happens it will not be possible to release the global read lock as "UNLOCK TABLES" command has to be issued in the same client where global read lock was acquired. This causes the dead lock. Fix: Existing code holds the rli->data_lock for the whole duration of commit operation. Instead of holding the lock for entire commit duration the code has been restructured in such a way that the lock is held only during the period when rli object is being updated.
向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

涪陵区| 龙南县| 临湘市| 宁国市| 白朗县| 龙里县| 临桂县| 福州市| 华阴市| 赫章县| 上杭县| 怀来县| 彭山县| 瓦房店市| 晋宁县| 巢湖市| 乌恰县| 登封市| 台中县| 余干县| 巴塘县| 崇文区| 长岭县| 修文县| 贵阳市| 松滋市| 舞阳县| 福州市| 寿宁县| 武乡县| 墨竹工卡县| 五台县| 开鲁县| 苍溪县| 铜鼓县| 崇文区| 兴宁市| 东海县| 岗巴县| 都昌县| 双柏县|