postgres crash recovery

fiona8953發表於2017-07-11

兩階段提交,在一些客戶端非同步事務,或者跨庫的事務處理中非常常見。

目前,如果資料庫crash,PostgreSQL恢復時,對2PC處理機制如下

* on prepare 2pc data (subxacts, commitrels, abortrels, invalmsgs) saved to xlog and to file, but file not is not fsynced  
* on commit backend reads data from file  
* if checkpoint occurs before commit, then files are fsynced during checkpoint  
* if case of crash replay will move data from xlog to files 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26477398/viewspace-2141898/,如需轉載,請註明出處,否則將追究法律責任。

相關文章