innodb_fast_shutdown中值為1或者2的區別是?


innodb_fast_shutdown=0 , 1 , 2時的意思分別是

0

把buffer pool中的臟頁刷到磁盤和合並insert buffer,當然包括redo log也會寫到磁盤中。

 

2

只把redo log刷到磁盤中,然后關閉

 

1

關於1,它解釋說,是先暫時略過一些flush操作,但沒有具體說忽略哪些操作。manual中也沒有詳細說明,

The default shutdown procedure for InnoDB, based on the configuration setting innodb_fast_shutdown=1. To save time, certain flush operations are skipped. This type of shutdown is safe during normal usage, because the flush operations are performed during the next startup, using the same mechanism as in crash recovery. In cases where the database is being shut down for an upgrade or downgrade, do a slow shutdown instead to ensure that all relevant changes are applied to the data files during the shutdown.

 

所以我不是很明白2和1的區別, 為了找到答案,只能看代碼了。最后發現這個函數

buf_flush_page_cleaner_thread,其中就描述了內部細微的區別。 因為涉及到具體的實現,我就沒看了。

 

好吧,有時間再看。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM