I'm trying to understand what is the difference between 1 and 2-phase commit and why 1phase commited does not make sense distributed systems. From my understanding here they are:
In 1 phase commit the coordinator commits the transaction on all nodes independently so if the transaction fails on one node it won't be rolled back on those where it's been committed already.
In 2 phase commit the coordinator on the 1st phase asks all nodes to prepare data to be committed on the 2nd phase. If some node are not able to prepare the data the transaction is rolled back. So after the phase 1 the node remains in the "locked" state until the transaction is actually committed.
Is the 2 points are the primary differences between the 1 and 2-phase commits or I got them wrong?