有谁知道为什么 Mysql 需要可序列化的隔离级别来实现 XA 事务的 ACID 属性,或者如果您使用可重复读取和 XA 会丢失什么?
但是,对于分布式事务,您必须使用 SERIALIZABLE 隔离级别来实现 ACID 属性。对非分布式事务使用 REPEATABLE READ 就足够了,但对于分布式事务则不行。
有谁知道为什么 Mysql 需要可序列化的隔离级别来实现 XA 事务的 ACID 属性,或者如果您使用可重复读取和 XA 会丢失什么?
但是,对于分布式事务,您必须使用 SERIALIZABLE 隔离级别来实现 ACID 属性。对非分布式事务使用 REPEATABLE READ 就足够了,但对于分布式事务则不行。
I believe it has to do with the nature of REPEATABLE READ
and the limitations of XA in the mysql engine (MySQL is not fully compliant with the XA spec).
A known issue is that certain crash scenarios with replication can cause a transaction to be absent from the binlog: From: Restrictions on XA Transactions
With the above, Consistency in ACID is lost.
I assume that the strict behavior forced by SERIALIZABLE
mitigates this to the extent required with how they describe the xid etc. working. But elaboration on these issues is suspiciously absent. Mysql 5.6 - Consistent Read