There have been 27888384 misaligned log IOs which required falling back to synchronous IO.
某一次在Production換新機後,突然Secondary狂噴如標題的Error。
Google後發現可能是Disk sector不Align的問題。
使用下列語法查詢Disk的狀態。
fsutil fsinfo ntfsinfo


查詢後發現
Primary Bytes Per Physical Sector為512
Secondary Bytes Per Physical Sector 為4096
於是我做了Lab研究Physical Sector不一致會有什麼結果
- Primary 512 –> Secondary 4K
無論是接Mirroring或是Alwayson 在Secondary都會收到Error,Secondary會有些微的Latency(<1s),但是不影響Primary的狀態 - Primary 4K –> Secondary 512
無論是接Mirroring或是Alwayson 在Secondary都沒有問題 - Primary 4K –> Secondary 4K
無論是接Mirroring或是Alwayson 在Secondary都沒有問題
關於Trace Flag T1800
嘗試在Primary啟用T1800,但是無法解決問題。必須要重啟Primary才能夠生效。
參考文獻
https://www.mssqltips.com/sqlservertip/5942/sql-server-misaligned-log-ios-which-required-falling-back-to-synchronous-io/
https://techcommunity.microsoft.com/t5/running-sap-applications-on-the/message-misaligned-log-ios-which-required-falling-back-to/ba-p/367796
https://sqlundercover.com/2019/07/08/error-misaligned-log-ios-which-required-falling-back-to-synchronous-io-and-slow-ag-synchronisation/