当前位置:网站首页>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.
边栏推荐
- 【MySQL】Mysql范式及外键作用
- 乡村基冲刺港交所:5个月期内亏2224万 SIG与红杉中国是股东
- MySQL数据库操作
- Delete table data or clear table
- 四象限时间管理有多好用?
- Excel快速对齐表格的中姓名(两个字姓名和三个字姓名对齐)
- R语言计算时间序列数据的移动平均值(滚动平均值、例如5日均线、10日均线等):使用zoo包中的rollmean函数计算k个周期移动平均值
- Vb how to connect mysql_vb how to connect to the database collection "advice"
- org.apache.jasperException(could not initialize class org)
- R language ggplot2 visualization: use the ggboxplot function of the ggpubr package to visualize the grouped box plot, use the ggpar function to change the graphical parameters (caption, add, modify th
猜你喜欢
The use of border controls
Internet banking stolen?This article tells you how to use online banking safely
MySQL的相关问题
女性服务社群产品设计
Kubernetes常用命令
.NET 20周年专访 - 张善友:.NET 技术是如何赋能并改变世界的
01 Encounter typescript, build environment
使用 GraphiQL 可视化 GraphQL 架构
C语言”三子棋“升级版(模式选择+AI下棋)
AVH Deployment Practice (1) | Deploying the Flying Paddle Model on Arm Virtual Hardware
随机推荐
女性服务社群产品设计
删除表格数据或清空表格
org.apache.jasperException(could not initialize class org)
MySQL基础篇【单行函数】
Ubantu专题4:xshell、xftp连接接虚拟机以及设置xshell复制粘贴快捷键
mysql black window ~ build database and build table
Efficient use of RecyclerView Section 1
thread_local 变量的析构顺序
R语言ggstatsplot包ggbarstats函数可视化条形图、并添加假设检验结果(包含样本数、统计量、效应大小及其置信区间、显著性、组间两两比较、贝叶斯假设)、检验结果报告符合APA标准
Codeforces Round #796 (Div. 2)(A-D)
网银被盗?这篇文章告诉你如何安全使用网银
The normal form of the database (first normal form, second normal form, third normal form, BCNF normal form) "recommended collection"
数据表插入数据insert into
第二届中国PWA开发者日
Efficient use of RecyclerView Section 2
7、常见面试口语提问问题汇总
Kubernetes原理剖析与实战应用手册,太全了
R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化箱图、使用font函数自定义图例标题文本(legend.title)字体的大小、颜色、样式(粗体、斜体)
Snake Project (Simple)
Emmet 语法