9-20 IBM Informix OnLine Database Server Administrator’s Guide
IBM Informix STAR and Two-Phase Commit Protocol
During thepostdecision phase the coordinator directs each database server to
either commit the changes or roll back thetransaction. If the coordinator
directsthe participants to commit the transaction, it waits to receive acknowl-
edgmentsfrom each before ending the global transaction. If the coordinator
directsthe participants to roll back the transaction, no acknowledgments are
expected from the participants.
Informix has implemented the two-phase commit protocol with the
presumed-abortoptimization, which allows faster processing because some of
thelogical log records written during the protocol can be buffered. The impli-
cationof the optimization for automatic participant recovery is described as
part of the discussion of automatic recovery that begins onpage 9-23. The
specific discussion of presumed-abort optimization begins onpage 9-29.
Protocol Components
The two-phase commit protocol relies on two kinds of communication
messages and logical log records:
Messages
Messagesmust pass between the coordinator and each participant to
ensure transaction atomicity (that is, all-or-nothing changes). Mes-
sages from the coordinator include a transaction identification
numberand instructions (such as “prepare to commit,” “commit,” or
“rollback”). Messages from each participant include the transaction
status and reports of action taken (such as “can commit,” “cannot
commit,” “committed,” or “rolled back”).
Logical log records
Logicallog records of the transaction are kept on stable storage (disk
or tape) to ensure data integrity and consistency, even if a failure
occursat a participating OnLine database server (participant or coor-
dinator). For more details about automatic two-phase commit
recovery in the event of failure, refer topage 9-23. For more details
about the logical log records that are written during the two-phase
commit protocol, refer topage 9-44.