Last Agent Optimization
Last agent optimization is a technique that reduces the number of sync point flows in a sync point tree. The initiator picks one adjacent agent as a last agent. Then the initiator sends prepare to the agents that were not selected as a last agent. When these agents all respond with a request commit back to the initiator, the initiator sends the last agent a request commit rather than the usual prepare. This last agent is free to select one of its cascaded initiators to be the last agent and so on. The ultimate last agent is given the commit decision for the entire sync point tree.
Figure 1 helps to explain last agent optimization. In this example, there are two non-z/VM® systems (NON-VM1 and NON-VM3) that can select a last agent. NON-VM1 selects NON-VM3 as a last agent. Then, NON-VM3 selects VM5 as a last agent. VM5 accepts being selected as a last agent, but does not select a last agent. NON-VM1, NON-VM3, and VM5 all contain a distributed application that communicates by a protected conversation. VM2, VM4, VM6, and VM7 all have a protected resource managed by a resource manager (RM).
The following describes the sync point flows that could take place in the hypothetical scenario illustrated in Figure 1 for last agent optimization:
- NON-VM1 selects NON-VM3 as last agent.
- NON-VM1 sends a prepare to VM2.
- VM2 responds with a request commit to NON-VM1.
- NON-VM1 sends a request commit to NON-VM3.
- NON-VM3 selects VM5 as a last agent.
- NON-VM3 sends a prepare to VM4.
- VM4 responds with a request commit to NON-VM3.
- NON-VM3 sends a request commit to VM5.
- VM5 sends a prepare to VM6 and VM7.
- VM6 and VM7 responds with a request commit to VM5.
- VM5 sends a committed to VM6 and VM7 (VM5 is the ultimate last agent and decides to commit for the entire sync point tree).
- VM6 and VM7 responds with a forget to
VM5.
At this point, the subtree containing VM5, VM6, and VM7 is now committed.
- VM5 sends a committed to NON-VM3.
- NON-VM3 sends a committed to VM4.
- VM4 responds with a forget to NON-VM3.
At this point, the subtree containing NON-VM3, VM4, VM5, VM6, and VM7 is now committed.
- NON-VM3 sends a committed to NON-VM1.
- NON-VM1 sends a committed to VM2.
- VM2 responds with a forget to NON-VM1.
At this point, the entire sync point tree is committed.
