IBM 000-8697 Manual Do Utilizador

Página de 702
9-24
IBM Informix OnLine Database Server Administrator’s Guide
Two-Phase Commit and Automatic Recovery
Coordinator recovery is not needed if the following occurs:
The coordinator has not recorded a decision.
The coordinator’s decision is to roll back the transaction.
If either 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
isolated failure of the coordinator database server process. If a system failure
occurred, the administrator reinitializes shared memory and restarts the
sqlexecd
 process. (Refer to
.) Otherwise, coordinator recovery
begins as part of OnLine processing.
As part of its regular activity, the tbinit process at the coordinator OnLine
detects first that a two-phase commit protocol was underway; second, that
the coordinator had reached a decision to commit; and third, that the coordi-
nator was terminated prematurely. To complete the transaction, tbinit forks
a database server process. (The tbinit process reads the value of
SQLEXEC
to
fork a new database server process. If
SQLEXEC
 is not set, tbinit uses the
pathname
$INFORMIXDIR
/lib/sqlturbo
. The database server process is
owned by the user who started tbinit, either informix or root.)
This server process acts as the new coordinator. It forks a new database server
process at each participant OnLine. (To do this, an sqlexecd process must be
running at each participant OnLine.)
The new 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
coordinator before 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
message that 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
send an acknowledgment indicating that their pieces of work committed, the
coordinator ends the transaction.