Transactions between two replicating master mysql servers

我们两清 提交于 2021-02-07 09:16:00

问题


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?


回答1:


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.

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



来源:https://stackoverflow.com/questions/36026769/transactions-between-two-replicating-master-mysql-servers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!