I am referring to the description of 2-phase commit at https://en.wikipedia.org/wiki/Two-phase_commit_protocol.
In the pre-commit phase, assume both resource managers have voted positively.
If the transaction manager initiates the commit by sending a COMMIT message to each resource manager and if only one of them returns an ACK, and the other does not, how does transaction manager rollback the already committed transaction from the first resource manager which succeeded in committing?
Isn't there a possibility of a transaction being committed on one resource manager and not the other while the global transaction has failed?
Yes, indeed.
In that case the transaction coordinator informs all parties, which successfully committed the transaction, that they must roll it back.
This should usually be a relatively rare condition caused by problems like hardware faults or running out of disk place. On many systems, the roll back involves undoing changes read from a journal file.
This is all explained in the article you link to as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With