Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.4k views
in Technique[技术] by (71.8m points)

2PC 二阶段提交的缺陷?

image.png

第4点中提到,无法确认事务是否已经提交,但为什么不查询所有参与者的提交状态,参与者提交不都会写日志吗?

然后我有转念一想,是不是宕掉的参与者未启动起来,所以无法查询日志?那也不对啊,参与者未启动起来,那就无法提供服务,也就不会出现数据不一致现象了,有此疑惑,求大佬解答


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
  • 参与者宕机了,所以查询不了状态。
  • 宕机的参与者在随后的某个时间重启,假如它宕机前就commit了事务。则此时它的数据和其它参与者不一致

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...