IBM 000-8697 Server User Manual


 
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
the road toward manual recovery, a complex and time-consuming process. It
is important 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 or tbmode -Z within the context of two-phase commit.
Figure 9-8 on page 9-33 and Figure 9-9 on page 9-35 illustrate the key charac-
teristics of a heuristic rollback and a heuristic end-transaction, respectively.A
general discussion of a heuristic rollback begins on page 9-32. A more
detailed discussion, including why the rollback might occur and the
messages that are generated, begins on page 9-36. A general discussion of a
heuristic end-transaction begins on page 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 by tbinit or by you, the
administrator), does not solve the problem. This is a key difference between
the two-phase commit protocol and the standard situation in a single OnLine
environment. The transaction remains open, and the logical log records
associated with the transaction remain open. Logical log files cannot be freed.
The transaction ends only after the coordinator receives information about
the rollback 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 in Figure 9-11 on page 9-49.
The second point is that a heuristic rollback leaves the transaction entry in the
participant’s shared-memory transaction table. This is another way of saying
that the transaction remains open or active. Eventually,when the coordinator
investigates why the participant OnLine did not acknowledge that the piece
of work committed, the entry in the transaction table is interpreted by the
coordinator as 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.