两阶段提交,在一些客户端异步事务,或者跨库的事务处理中非常常见。
目前,如果数据库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/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26477398/viewspace-2141898/