Google SWE teaches systems design | EP13: Two Phase Commit

preview_player
Показать описание
My girlfriend didn't like it when I told her I had commitment issues, so to show that I was making an effort I told her I was prepared to make one (hope the network fails when she tells me in the second phase).

Recommended Reading:
Designing Data Intensive Applications, Chapter 9
Рекомендации по теме
Комментарии
Автор

hi jordan, thanks for the video. i have a question about the coordinator failover: it says,

"System is completely blocked, nodes cannot abort a transaction as other ones may have committed it, there's no way to know." but if all nodes earlier said OK in their prepare phase, wouldn't all the nodes, despite the coordinator going down during the commit phase, still have the commit go through? I thought this would be the case due to transactional guarantees where the transaction is guaranteed to execute (even if the coordinator goes down). Why would we need to send an abort message from the coordinator if it goes down, because couldn't we just wait until the coordinator comes back to to complete the commit for the rest of the nodes that haven't been committed to?

pipdot
Автор

That's great, but, even having heard about 2pc several times, I have no idea how this could be actually implemented. Too many edge cases. It seems to me that the prepare phase should be run in a separate transaction and should be committed. Only in that case we can ensure that no database constrains are violated. At the same time it should have some kind of flag, which makes this record invisible until the second phase is completed. So the second phase only removes this flag, which could be done with a high probability. Am I going wrong way?

ВалентинТ-хц
Автор

On what basis a node guarantees that it will be able to commit? Because you can never be sure about that.

harshpalsingh
Автор

Great video!
Quick ques.: Why coordinator node has to be a single machine to be the ingle point of failure ? Can't we do replication for coordinator node as well ?

Piyush-kyee
Автор

Hello Jordan! I've made copies of your slides to take notes with. There is so much information for each chapter of the slides. How would you suggest studying and retaining this much information? Like, should we convert these to flashcards, or should we just reread the slides and notes to get familiar with the information again?

tom-lylx
Автор

hey jordan, great content as always.
quick question -

When the coordinator asks all the nodes to commit .. do we assume that all the nodes have isolation levels with pessimistic implementations ?
with optimistic isolation, how can we guarantee if all nodes would in fact actually commit the transaction and not roll back ?

shubhamqweasd
Автор

The stress in "heterogeneous" is not where you think it is - it's on the first syllable of the "geneous" part :p

adhocish