wangcy6 / weekly

每周分享 技术面试必备基础知识、Leetcode 题解、Java、C++、Python、后端面试、操作系统、计算机网络、系统设计
https://wangcy6.github.io
Apache License 2.0
11 stars 1 forks source link

【英语阅读】-2019-11-22 2pc提交,最后一次提交或者回滚失败怎办? #33

Open watchpoints opened 4 years ago

watchpoints commented 4 years ago
Coordinator                                         Participant
                              QUERY TO COMMIT
                -------------------------------->
                              VOTE YES/NO           prepare*/abort*
                <-------------------------------
commit*/abort*                COMMIT/ROLLBACK
                -------------------------------->
                              ACKNOWLEDGMENT        commit*/abort*
                <--------------------------------  
end

2pc 提交,在第一阶段发现 失败,可以回滚,在第二阶段 如果Participant出现异常(概率可能存在的)。回滚失败或者其他问题,这样数据出现不一致的情况。 这个时候 该怎么, 业务成功还是失败?完全依靠没有失败的执行吗

watchpoints commented 4 years ago

image image

image

watchpoints commented 4 years ago

@aleafboat pc提交,最后一次提交或者回滚失败怎办? 没回回答呀,我猜测和一样,去查询

The worst case scenario is when the co-ordinator is itself a participant, and grants itself a vote on the outcome of the protocol. Then a crash to the co-ordinator takes out both it and a participant, guaranteeing that the protocol will remain blocked, and as a result of only one failure.

watchpoints commented 4 years ago

终止程序:

watchpoints commented 4 years ago

存在的问题: 如果协调者没有记录,参与者也没有保存协调者发来的记录,只能见鬼了

image

watchpoints commented 4 years ago

https://yemablog.com/posts/tcc-1 https://yemablog.com/posts/tcc-1 如果 confirm 或者 cancel 失败怎么办?重试! 但重试过程中宕机了怎么办?上下文都没了,重启后还咋重试?

image

image image image