当前位置:网站首页>Two stage submission and three stage submission
Two stage submission and three stage submission
2022-07-27 15:21:00 【Hua Weiyun】
Two stage submission and three-stage submission
Two-phase commit
In the last article, we talked about two-stage submission 2pc, Two phase submission still has many disadvantages , It may cause data inconsistency due to network problems , For example, only some participants can receive the request to submit a transaction sent by the coordinator due to network problems , In this way, some participants commit transactions while others fail to commit, resulting in data inconsistency , The second problem is if the coordinator hangs up , The participant has neither committed nor rolled back , The third problem is that the services of participating nodes are blocked when executing at the same time , Can't provide external services
Three stage commit
So what is three-phase submission , Can three-stage submission solve these problems ?
The three-stage submission is divided into CanCommit Stage ,PreCommit Phase and doCommit Stage . The first stage is to check whether its state meets the conditions of transaction operation , Generally, it is possible to obtain the lock of this distributed transaction first , The second stage is to start the transaction , But didn't submit , And return the result to the coordinator , The third stage is the commit or rollback of transactions .
This is the general content of the three-stage submission , So does the three-phase submission solve the problems caused by the two-phase submission ? Three stage submission participants also have a timeout mechanism , stay preCommit When , If the coordinator's message is not received, the interrupt transaction will be executed , stay doCommit If the coordinator's message is not received in the phase, the transaction will be committed , The problem of data consistency and the coordinator's single point of failure still exist
summary
There will be some problems in two-phase submission and three-phase submission , Compared with the two-phase submission, the three-phase submission has more participants' timeout mechanism , But the remaining problems have not been solved , For example, the consistency of data and the single point of failure of the coordinator .
️ Thank you for your
If you think this is helpful for you :
- Welcome to follow me ️, give the thumbs-up , Comment on , forward
- Focus on
Panpan small class, Push good articles for you regularly , There are also group chat and irregular lottery activities , You can say what you want , Communicate with the great gods , Learning together .
边栏推荐
猜你喜欢

周鸿祎:数字安全能力落后也会挨打

STM32 CAN 通信 滤波设置问题

Basic usage of kotlin

Four kinds of relay schemes driven by single chip microcomputer

Unity performance optimization ----- occlusion culling of rendering optimization (GPU)

代码覆盖率统计神器-jacoco工具实战

See "sense of security" in uncertainty Volvo asked in 2022

Jmeter录制接口自动化

Kubernetes CNI 分类/运行机制

IJCAI 2022杰出论文公布,大陆作者中稿298篇拿下两项第一
随机推荐
Leetcode-1737-满足三条件之一需改变的最少字符数
《剑指Offer》数组中的逆序对
Comparison of advantages and disadvantages between instrument amplifier and operational amplifier
关于印发《深圳市工业和信息化局绿色制造试点示范管理暂行办法》的通知
事务_基本演示和事务_默认自动提交&手动提交
The reverse order pairs in the "sword finger offer" array
MySQL 面试40连问,面试官你再问下去我可要翻脸了
After configuring corswebfilter in grain mall, an error is reported: resource sharing error:multiplealloworiginvalues
Wechat applet realizes music search page
lua学习笔记
Notice of Nanshan District Civil Affairs Bureau on carrying out the grade evaluation of social organizations in Nanshan District in 2022
网络设备硬核技术内幕 路由器篇 4 贾宝玉梦游太虚幻境(下)
Finally, someone finished all the dynamic planning, linked list, binary tree and string required for the interview
西瓜书《机器学习》阅读笔记之第一章绪论
泛型
The mobile terminal uses the list component of vantui. When multiple tab items are switched back and forth, the list is loaded many times, resulting in the failure of normal display of data
Zhou Hongyi: if the digital security ability is backward, it will also be beaten
Selenium 报错:session not created: This version of ChromeDriver only supports Chrome version 81
See "sense of security" in uncertainty Volvo asked in 2022
What is the breakthrough point of digital transformation in the electronic manufacturing industry? Lean manufacturing is the key