两个复制主mysql服务器之间的事务 [英] Transactions between two replicating master mysql servers

查看:70
本文介绍了两个复制主mysql服务器之间的事务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用一个复制的mysql master通过innodb引擎来控制数据库,如果一个事务要在数据库A上启动,那么在提交事务之前,该行是否会锁定数据库B?

With a replicating mysql master to master database with innodb engine, if one transaction were to initiate on database A will that row lock for database B until the transaction has been committed?

推荐答案

获得第一个事务的主服务器与第二个事务完全分开,并且它们通过二进制日志进行通信.

The master getting the first transaction is completely separate from the second master and they communicate through a binary log.

https://dev.mysql.com/doc/refman/5.7/en/replication-formats.html

在某些事物需要事务处理的情况下,直到事务处理完成后,才会将实际语句写入日志.

In the case of something requiring a transaction, then the actual statements are not written to the log until the transaction is complete.

https://dev.mysql.com/doc/refman/5.7/en/replication-features-transactions.html

因此,第二个主服务器应该完全不受阻碍,因为在第一个主服务器完成处理之前,它实际上对请求一无所知.

So the second master should be completely unhindered, since it won't actually know anything about the request until the first master is done processing it.

(不过,标准警告可能取决于SBR/RBR/mix的复制类型以及实际的事务.)

(Standard caveats though of it may depend on what type of replication SBR/RBR/mix and the actual transactions.)

这篇关于两个复制主mysql服务器之间的事务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆