当前位置:网站首页>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.
边栏推荐
- TRACE32 - Common Operations
- Visualize GraphQL schemas with GraphiQL
- The R language ggstatsplot package ggbarstats function visualizes bar charts, and adds hypothesis test results (including sample number, statistics, effect size and its confidence interval, significan
- TextBlock控件入门基础工具使用用法,取上法入门
- 做事软件开发-法的重要性所在以及合理结论的认识
- R language ggplot2 visualization: use the ggmapplot function of the ggpubr package to visualize the MA plot (MA-plot), the font.legend parameter and the font.main parameter to set the title and legend
- R语言ggstatsplot包ggbarstats函数可视化条形图、并添加假设检验结果(包含样本数、统计量、效应大小及其置信区间、显著性、组间两两比较、贝叶斯假设)、检验结果报告符合APA标准
- 最小费用最大流问题详解
- Implement anti-shake and throttling functions
- 大健云仓冲刺美股:增营收反减利润 京东与DCM是股东
猜你喜欢

对话庄表伟:开源第一课

乡村基冲刺港交所:5个月期内亏2224万 SIG与红杉中国是股东

mysql black window ~ build database and build table

Kubernetes principle analysis and practical application manual, too complete

TRACE32——C源码关联

Ubantu project 4: xshell, XFTP connected the virtual machine and set xshell copy and paste the shortcut

Tencent Cloud Deployment----DevOps

Use of radiobutton

What is the difference between BI software in the domestic market?

Public Key Retrieval is not allowed error solution when DBeaver connects to MySQL 8.x
随机推荐
Visualize GraphQL schemas with GraphiQL
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 table to Excel
R语言检验样本是否符合正态性(检验样本是否来自一个正态分布总体):shapiro.test函数检验样本是否符合正态分布(normality test)
工程水文学试卷
Linux查看redis版本(查看mongodb版本)
Matlab矩阵基本操作(定义,运算)
After Grafana is installed, the web opens and reports an error
复制延迟案例(1)-最终一致性
工程水文学复习资料
大健云仓冲刺美股:增营收反减利润 京东与DCM是股东
女性服务社群产品设计
Synchronized和volatile 面试简单汇总
力扣:56. 合并区间
hough变换检测直线原理(opencv霍夫直线检测)
Codeforces Round #796 (Div. 2)(A-D)
Word表格转到Excel中
修改SQL语言实现Mysql 多表关联查询优化
ASP.NET Core generates continuous Guid