9-24 IBM Informix OnLine Database Server Administrator’s Guide
Two-Phase Commit and Automatic Recovery
Coordinator recovery isnot needed if the following occurs:
The coordinator has not recorded a decision.
The coordinator’s decision is to roll back the transaction.
Ifeither one of these two conditions is true, the situation is handled by partic-
ipant recovery.
Coordinator failure can occur as a result of either a system failure or the
isolatedfailure of the coordinator database server process. If a system failure
occurred, the administrator reinitializes shared memory and restarts the
sqlexecd process. (Refer topage 9-23.) Otherwise, coordinator recovery
begins as part of OnLine processing.
As part of its regular activity, thetbinit process at the coordinator OnLine
detects first that a two-phase commit protocol was underway; second, that
thecoordinator had reached a decision to commit; and third, that the coordi-
nator was terminated prematurely. To complete the transaction,tbinit forks
adatabase server process. (The tbinit process reads the value of SQLEXEC to
fork a new database server process. IfSQLEXEC is not set, tbinit uses the
pathname$INFORMIXDIR /lib/sqlturbo. The database server process is
owned by the user who started tbinit, eitherinformix or root.)
Thisserver process acts as the new coordinator.It forks a new database server
processat each participant OnLine. (To do this, an sqlexecd process must be
running at each participant OnLine.)
Thenew coordinator sends a message to each participant to obtain the status
of its piece of work. If the participant received a commit message from the
coordinatorbefore it failed, the participant would have committed the piece
of work, removed the entry from its transaction table, and would have no
knowledge of the transaction. Thus, if the new coordinator receives a
messagethat the transaction status is unknown, it knows the piece of work is
committed.
If the new coordinator receives a message that the transaction status is “can
commit,”a message to commit is sent to the participant. After all participants
sendan acknowledgment indicating that their pieces of work committed, the
coordinator ends the transaction.