Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 8. Two-Phase Commit > Optimizations and Variations

8.4. Optimizations and Variations

There are many variations of two-phase commit to handle special transaction communications patterns. We discuss three of them here: reinfection, where a transaction revisits a resource manager after the two-phase commit protocol has started; transfer of coordination, to allow one resource manager to execute one-phase-commit; and phase zero, where a transaction delays sending updates to some resource managers until after it has finished executing.

There are also many optimizations of two-phase commit to save messages and reduce the number of eager log writes. The most obvious is to avoid two-phase commit altogether when there is only one resource manager in a transaction, and run one-phase commit instead. This is a fairly important optimization since many transactions access only one resource manager. If a transaction issues Start and Commit but never accesses a resource manager, then it can run no-phase commit. That is, the coordinator can commit immediately without sending a message to any outside agent. Several other optimizations are described later: presumed abort, to reduce the amount of logging for transactions that abort; reducing a round of messages for read-only resources; and the cooperative termination protocol, to increase the chance that a blocked resource manager can become unblocked.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial