9-32 IBM Informix OnLine Database Server Administrator’s Guide
Heuristic Decisions: What and Why
Once a heuristic rollback or end-transaction occurs, you have started down
theroad toward manual recovery,a complex and time-consumingprocess. It
isimportant for you to fully understand heuristic decisions, as that is the best
means for avoiding them. You should always be wary of executing
tbmode -z ortbmode -Z within the context of two-phase commit.
Figure9-8 on page 9-33and Figure 9-9on page 9-35 illustrate the key charac-
teristicsof a heuristic rollback and a heuristic end-transaction, respectively.A
general discussion of a heuristic rollback begins onpage 9-32. A more
detailed discussion, including why the rollback might occur and the
messages that are generated, begins onpage 9-36. A general discussion of a
heuristic end-transaction begins onpage 9-32. A more detailed discussion,
including why you might take this action and its consequences, begins on
page 9-40.
Two points about the heuristic rollback bear emphasis.
The first point is that a heuristic rollback does not end or close the trans-
action.If the piece of work is creating a long-transaction condition, the action
of rolling back the piece of work (whether done bytbinit or by you, the
administrator),does not solve the problem. This is a key difference between
thetwo-phase commit protocol and the standard situation in a single OnLine
environment. The transaction remains open, and the logical log records
associatedwith the transaction remain open. Logical log files cannot be freed.
The transaction ends only after the coordinator receives information about
therollback from the participant, and, in response, directs the participant to
end the transaction. This additional instruction from the coordinator
removes the entry from the participant’s transaction table, ends the piece of
work,and enables the logical log records associated with the piece of work to
be closed.The complete protocol is illustrated inFigure 9-11 on page9-49.
Thesecond point is that a heuristic rollback leaves the transaction entry in the
participant’sshared-memory transaction table. This is another way of saying
thatthe transaction remains open or active. Eventually,when the coordinator
investigateswhy the participant OnLine did not acknowledge that the piece
of work committed, the entry in the transaction table is interpreted by the
coordinatoras evidence of a heuristic rollback. As mentioned in the previous
paragraph,the coordinator responds to the heuristic rollback by directing the
participant to end the transaction.