当前位置:网站首页>Handling write conflicts under multi-master replication (4) - multi-master replication topology
Handling write conflicts under multi-master replication (4) - multi-master replication topology
2022-07-31 15:32:00 【Huawei cloud】
The topology of replication describes the communication path through which write requests are propagated from one node to another.With two masters, as in Figure-7, there is only one reasonable topology: M1 must synchronize all his writes to M2, and vice versa.When there are more than two M, a variety of different topologies are possible.Figure-8 illustrates some examples.
The most common topology is all-to-all, i.e. Figure-8, where each M synchronizes its writes to all other Ms.
But more restricted topologies are also used: for example, MySQL only supports circular topologies, where each node receives writes from the previous node and writes those writes (plus its own writes)In) forwarded to the subsequent node.
Another popular structure is the star shape ^v.A designated root node forwards writes to all other nodes.The star topology can be generalized to trees.
Ring, star topology
Write requests need to go through multiple nodes to reach all replicas, i.e. intermediate nodes need to forward data changes received from other nodes.To avoid infinite loops, each node needs to be assigned a unique identifier, and each write request in the replication log is marked with the identifiers of all nodes that have passed.When a node receives a data change marked with its own identifier, the data change will be ignored, avoiding repeated forwarding.
Questions
If a node fails, it may disrupt the flow of replicated messages between other nodes, rendering them unable to communicate until the node is repaired.Topologies can be reconfigured to work on failed nodes, but in most deployments this reconfiguration must be done manually.A more densely connected topology (such as all-to-all) is more fault-tolerant because it allows messages to travel along different paths, avoiding a single point of failure.
All-to-all topologies can also be problematic.Especially when some network links may be faster than others (network congestion), as a result some replicated messages may "overtake" others, as shown in Figure-9.
Client A sends L1A row is inserted into the table, and B updates the row in L3.However, L2 can receive writes in a different order: updates (from its perspective, updates to rows that don't exist in the database) can be received first, and then L1's insert log (which should arrive before the update log).
This is a causality problem, similar to "consistent prefix reads": updates depend on previously completed inserts, so make sure all nodes receive inserts before processing updates.Adding a timestamp to each log write is not enough, mainly because there is no way to ensure that the clocks are fully synchronized and thus the received logs cannot be ordered correctly on L2.
To properly order log messages, a version vector can be used.Conflict detection technology is not fully implemented in many primary replication systems.As PostgreSQL BDR does not provide causal ordering of writes, Tungsten Replicator for MySQL does not even attempt to detect conflicts.
边栏推荐
- 格林美瑞交所IPO:募资3.8亿美元 更多中国企业将赴欧洲上市
- 为什么毕业季不要表白?
- DBeaver连接MySQL 8.x时Public Key Retrieval is not allowed 错误解决
- Public Key Retrieval is not allowed error solution when DBeaver connects to MySQL 8.x
- Female service community product design
- 435. 无重叠区间
- Gorm—Go语言数据库框架
- ML.NET相关资源整理
- The use of border controls
- Ubantu专题5:设置静态ip地址
猜你喜欢
Getting Started with TextBlock Control Basic Tools Usage, Get Started
OPPO在FaaS领域的探索与思考
格林美瑞交所IPO:募资3.8亿美元 更多中国企业将赴欧洲上市
全新宝马3系上市,安全、舒适一个不落
Female service community product design
国内市场上的BI软件,到底有啥区别
Internet banking stolen?This article tells you how to use online banking safely
对话庄表伟:开源第一课
Ubantu project 4: xshell, XFTP connected the virtual machine and set xshell copy and paste the shortcut
Visualize GraphQL schemas with GraphiQL
随机推荐
The use of button controls
Oracle动态注册非1521端口
思路迪医药冲刺港股:5个月亏2.9亿 泰格医药与先声药业是股东
数据库的范式(第一范式,第二范式,第三范式,BCNF范式)「建议收藏」
01 邂逅typescript,环境搭建
多主复制的适用场景(2)-需离线操作的客户端和协作编辑
删除表格数据或清空表格
Why is the field of hacking almost filled with boys?
Why don't you make a confession during the graduation season?
435. 无重叠区间
RecyclerView高效使用第二节
JVM参数解析 Xmx、Xms、Xmn、NewRatio、SurvivorRatio、PermSize、PrintGC「建议收藏」
R language ggplot2 visualization: use the ggboxplot function of the ggpubr package to visualize the box plot, use the font function to customize the font size, color, style (bold, italic) of the legen
Excel快速对齐表格的中姓名(两个字姓名和三个字姓名对齐)
Female service community product design
TRACE32——基于SNOOPer的变量记录
mongo进入报错
json到底是什么(c# json)
763.划分字母区间——之打开新世界
Precautions and solutions when SIGABRT error is reported