SlideShare a Scribd company logo
CS 603 
Distributed Transactions 
February 18, 2002
What is a Transaction? 
• Atomic 
– The external view is that either everything in the 
transaction happened, or nothing did 
• Consistent 
– If the start state is valid, the end state is valid 
• Isolated 
– A transaction in process is not affected by and does 
not affect any other transaction 
• Durable 
– Once complete, the effects of a transaction are 
permanent, even in the event of failure.
Distributed Transactions 
• What is the difference with Distributed 
Transactions? 
– NOTHING! 
– Must still support ACID properties 
– Important for all the same reasons 
• Why do we study Distributed 
Transactions? 
– Some properties harder to implement 
– Basic single-system techniques not sufficient
What is a Distributed 
Transaction? 
Data 
Transaction 
component 
Transaction 
component 
Data 
Data 
Transaction 
component 
Transaction 
component 
Data
Why are Distributed 
Transactions Hard? 
• Atomic 
– Different parts of a transaction may be at different 
sites 
– How do we ensure all or none committed? 
• Consistent 
– Failure may affect only part of transaction 
• Isolated 
– Commitment must occur “simultaneously” at all sites 
• Durable 
– Not much different when other problems solved 
– Makes “delayed commit” difficult
Key Issues 
• Commitment 
– Standard techniques preserve properties 
when commit occurs 
– Distributed systems need commit protocols so 
we know when commit has occurred 
• Failures 
– Standard techniques support durability for 
commit/abort 
– What happens if a site fails during 
commitment?
Committing a Distributed 
Transaction 
Data 
Transaction 
component 
log 
Transaction 
component 
Data 
log 
Data 
Transaction 
component 
log 
Transaction 
component 
Data 
log
Two-Phase Commit 
(Lamport ’76, Gray ’79) 
• Assumes central coordinator 
– Coordinator initiates protocol 
– Participants: entities with actions to be 
committed/aborted 
• Phase 1: 
– Coordinator asks if participants can commit 
– Participants respond yes/no 
• Phase 2: 
– If all votes yes, coordinator sends Commit 
• Otherwise send Abort 
– Participants send Have Committed / Have Aborted
Two-Phase Commit 
Data 
Transaction 
component 
log 
Done Done 
Done 
Transaction 
component 
Data 
log 
Data 
Transaction 
component 
log 
Done 
Transaction 
component 
Data 
log 
CanCommit? CanCommit? 
Coordinator 
Commit 
CanCommit? CanCommit? 
Yes 
Yes 
Yes 
Yes 
Commit 
Commit Commit
Two-Phase Commit: 
Fault Tolerance 
• Participant fails in Phase 1: 
– Coordinator doesn’t get unanimous yes 
– Abort 
• Participant fails in Phase 2: 
– On reawakening, can ask coordinator if it 
should commit or abort 
– Requires that both commit and abort states 
be durable before sending “yes” vote
Two-Phase Commit: 
Problems 
• Blocks on failure 
– Timeout before abort if participant fails 
– All participants must wait for recovery if 
coordinator fails 
• While blocked, transaction must remain 
Isolated 
– Hold locks on data items touched 
– Prevents other transactions from completing 
• Solution: Wednesday

More Related Content

Distributed Transaction

  • 1. CS 603 Distributed Transactions February 18, 2002
  • 2. What is a Transaction? • Atomic – The external view is that either everything in the transaction happened, or nothing did • Consistent – If the start state is valid, the end state is valid • Isolated – A transaction in process is not affected by and does not affect any other transaction • Durable – Once complete, the effects of a transaction are permanent, even in the event of failure.
  • 3. Distributed Transactions • What is the difference with Distributed Transactions? – NOTHING! – Must still support ACID properties – Important for all the same reasons • Why do we study Distributed Transactions? – Some properties harder to implement – Basic single-system techniques not sufficient
  • 4. What is a Distributed Transaction? Data Transaction component Transaction component Data Data Transaction component Transaction component Data
  • 5. Why are Distributed Transactions Hard? • Atomic – Different parts of a transaction may be at different sites – How do we ensure all or none committed? • Consistent – Failure may affect only part of transaction • Isolated – Commitment must occur “simultaneously” at all sites • Durable – Not much different when other problems solved – Makes “delayed commit” difficult
  • 6. Key Issues • Commitment – Standard techniques preserve properties when commit occurs – Distributed systems need commit protocols so we know when commit has occurred • Failures – Standard techniques support durability for commit/abort – What happens if a site fails during commitment?
  • 7. Committing a Distributed Transaction Data Transaction component log Transaction component Data log Data Transaction component log Transaction component Data log
  • 8. Two-Phase Commit (Lamport ’76, Gray ’79) • Assumes central coordinator – Coordinator initiates protocol – Participants: entities with actions to be committed/aborted • Phase 1: – Coordinator asks if participants can commit – Participants respond yes/no • Phase 2: – If all votes yes, coordinator sends Commit • Otherwise send Abort – Participants send Have Committed / Have Aborted
  • 9. Two-Phase Commit Data Transaction component log Done Done Done Transaction component Data log Data Transaction component log Done Transaction component Data log CanCommit? CanCommit? Coordinator Commit CanCommit? CanCommit? Yes Yes Yes Yes Commit Commit Commit
  • 10. Two-Phase Commit: Fault Tolerance • Participant fails in Phase 1: – Coordinator doesn’t get unanimous yes – Abort • Participant fails in Phase 2: – On reawakening, can ask coordinator if it should commit or abort – Requires that both commit and abort states be durable before sending “yes” vote
  • 11. Two-Phase Commit: Problems • Blocks on failure – Timeout before abort if participant fails – All participants must wait for recovery if coordinator fails • While blocked, transaction must remain Isolated – Hold locks on data items touched – Prevents other transactions from completing • Solution: Wednesday
© 2024 SlideShare from Scribd

玻璃钢生产厂家广东摆件玻璃钢雕塑厂家阜阳玻璃钢雕塑定做衢州欧式玻璃钢雕塑生产厂家重庆佛像玻璃钢雕塑优势舟山玻璃钢雕塑生产厂家元旦美陈商场广场广州市白云区玻璃钢雕塑厂三门峡佛像校园玻璃钢雕塑厂家郑州哪里有玻璃钢雕塑厂家湛江玻璃钢雕塑厂家直销桥北商场美陈布置美陈商场花艺网站蚌埠玻璃钢雕塑人物定制道教玻璃钢雕塑菏泽制作玻璃钢雕塑公司多少钱祖庙玻璃钢卡通公仔雕塑玻璃钢海洋雕塑品牌鹤壁标识玻璃钢雕塑望城玻璃钢花盆花器玻璃钢花盆厂家报价玻璃钢生蚝雕塑玻璃钢马车雕塑教程玻璃钢浮雕雕塑品牌好栖霞商场美陈策划湖州玻璃钢雕塑定制海王玻璃钢雕塑湖北景观玻璃钢雕塑供应商郑州公园玻璃钢雕塑市场麻城玻璃钢花盆花器无机玻璃钢花盆的制作工艺香港通过《维护国家安全条例》两大学生合买彩票中奖一人不认账让美丽中国“从细节出发”19岁小伙救下5人后溺亡 多方发声单亲妈妈陷入热恋 14岁儿子报警汪小菲曝离婚始末遭遇山火的松茸之乡雅江山火三名扑火人员牺牲系谣言何赛飞追着代拍打萧美琴窜访捷克 外交部回应卫健委通报少年有偿捐血浆16次猝死手机成瘾是影响睡眠质量重要因素高校汽车撞人致3死16伤 司机系学生315晚会后胖东来又人满为患了小米汽车超级工厂正式揭幕中国拥有亿元资产的家庭达13.3万户周杰伦一审败诉网易男孩8年未见母亲被告知被遗忘许家印被限制高消费饲养员用铁锨驱打大熊猫被辞退男子被猫抓伤后确诊“猫抓病”特朗普无法缴纳4.54亿美元罚金倪萍分享减重40斤方法联合利华开始重组张家界的山上“长”满了韩国人?张立群任西安交通大学校长杨倩无缘巴黎奥运“重生之我在北大当嫡校长”黑马情侣提车了专访95后高颜值猪保姆考生莫言也上北大硕士复试名单了网友洛杉矶偶遇贾玲专家建议不必谈骨泥色变沉迷短剧的人就像掉进了杀猪盘奥巴马现身唐宁街 黑色着装引猜测七年后宇文玥被薅头发捞上岸事业单位女子向同事水杯投不明物质凯特王妃现身!外出购物视频曝光河南驻马店通报西平中学跳楼事件王树国卸任西安交大校长 师生送别恒大被罚41.75亿到底怎么缴男子被流浪猫绊倒 投喂者赔24万房客欠租失踪 房东直发愁西双版纳热带植物园回应蜉蝣大爆发钱人豪晒法院裁定实锤抄袭外国人感慨凌晨的中国很安全胖东来员工每周单休无小长假白宫:哈马斯三号人物被杀测试车高速逃费 小米:已补缴老人退休金被冒领16年 金额超20万

玻璃钢生产厂家 XML地图 TXT地图 虚拟主机 SEO 网站制作 网站优化