当前位置:网站首页>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.
边栏推荐
- WPF项目--控件入门基础用法,必知必会XAML
- R语言ggplot2可视化:使用ggpubr包的ggmaplot函数可视化MA图(MA-plot)、font.legend参数和font.main参数设置标题和图例字体加粗
- Emmet syntax
- update data table update
- Ubuntu Topic 5: Setting a Static IP Address
- R语言计算时间序列数据的移动平均值(滚动平均值、例如5日均线、10日均线等):使用zoo包中的rollmean函数计算k个周期移动平均值
- 力扣:714. 买卖股票的最佳时机含手续费
- MySQL基础篇【单行函数】
- Doing things software development - the importance of law and understanding of reasonable conclusions
- 多主复制的适用场景(2)-需离线操作的客户端和协作编辑
猜你喜欢
随机推荐
QGIS 加载WMS数据,重新投影
what exactly is json (c# json)
RecyclerView高效使用第二节
R语言ggplot2可视化:使用ggpubr包的ggmaplot函数可视化MA图(MA-plot)、font.legend参数和font.main参数设置标题和图例字体加粗
Use of radiobutton
After Grafana is installed, the web opens and reports an error
border控件的使用
Tencent Cloud Deployment----DevOps
leetcode303 Weekly Match Replay
力扣:738.单调递增的数字
Linux check redis version (check mongodb version)
Destruction order of thread_local variables
TRACE32——C源码关联
.NET 20周年专访 - 张善友:.NET 技术是如何赋能并改变世界的
mysql黑窗口~建库建表
RecyclerView的高效使用第一节
What is the difference between BI software in the domestic market?
TRACE32 - SNOOPer-based variable logging
R language moves time series data forward or backward (custom lag or lead period): use the lag function in the dplyr package to move the time series data forward by one day (set the parameter n to a p
Word表格转到Excel中