官方mysql數據跨多硬盤方案,執行重建或修復表時,會使mysqld崩潰

MySQL遇到單硬盤IO性能不足時

linux下 可使用軟鏈對目錄甚至單個文件解決跨硬盤問題。注意的是,官方並不推薦,官方文檔 中說可能遇到不可預知的問題。
實踐中,我試過

  • 對目錄進行建軟鏈,生產環境下,過100G的數據,沒問題。
  • 對單個*.ibd文件建軟鏈,正常的sql也不會有問題。但alter語句–重建表時,就直接把軟鏈文件當文件複寫,即跨硬盤的目標.ibd文件直接被無視。

官方的跨硬盤方案是:*.isl文件,5.6後纔有

文檔在此:http://dev.mysql.com/doc/refman/5.6/en/tablespace-placing.html

其實就是建一個同表名的 *.isl文件,內容是ibd文件的完整路徑。
正常情況下也是運行良好。
但在實際生產環境下,我遇到過:

InnoDB: Submit a detailed bug report to http://bugs.mysql.com
InnoDB: error in sec index entry update in

關於bug:InnoDB: error in sec index entry update in,官網 http://bugs.mysql.com 也能搜索到。 感覺還沒有修復。
check table xx;語句會顯示:

mysql>check table ***tbl;
+-------------------------+-------+----------+----------+
| Table                   | Op    | Msg_type | Msg_text |
+-------------------------+-------+----------+----------+
| ***db.***tbl            | check | error    | Corrupt  |
+-------------------------+-------+----------+----------+

執行重建表,直接崩了:

version '5.6.23-72.1-log'
...
InnoDB: Operating system error number 18 in a file operation.
InnoDB: Error number 18 means 'Invalid cross-device link'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html
2015-10-15 11:51:59 7fbbe8bf0700  InnoDB: Assertion failure in thread 140445040445184 in file handler0alter.cc line 5004
InnoDB: Failing assertion: error == DB_SUCCESS
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
03:51:59 UTC - mysqld got signal 6 ;
....

-_=!

datadir目錄下有 井號開頭的.frm臨時文件與.ibd臨時文件,此後無法再啓動mysql。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章