很久以前对innodb_support_xa存在一点误解,当初一直认为innodb_support_xa只控制外部xa事务,内部的xa事务是mysql内部进行控制,无法人为干预(这里说的内部xa事务主要是指binlog与innodb的redo log保持一致性所采用的内部xa事务)。直到前阵子在微博上看到有人讨论mysql数据安全时才仔细去手册上查看了关于innodb_support_xa的解释,这几天又与同事再次讨论了这个问题,于是想着还是将其记录下来。先看官方手册上对innodb_support_xa的解释:
“EnablesInnoDBsupport for two-phase commit in XA transactions, causing an extra disk flush for transaction preparation. This set-ting is the default. The XA mechanism is used internally and is essential for any server that has its binary log turned on and is accepting changes to its data from more than one thread. If you turn it off, transactions can be written to the binary log in a different order from the one in which the live database is committing them. This can produce different data when the binary log is replayed in disaster recovery or on a replication slave. Do not t

本文深入探讨了InnoDB存储引擎中的innodb_support_xa参数,揭示了它在确保多实例分布式事务和内部XA事务中保持binlog与redo log一致性的重要性。同时,分析了innodb_flush_log_at_trx_commit参数的三种模式对数据安全和性能的影响,并给出了针对主从库的合理配置建议。
最低0.47元/天 解锁文章
687

被折叠的 条评论
为什么被折叠?



