Phase 1 of the Extended Two-Phase Commit Protocol is identical to Phase 1 of the two-phase commit protocol we have described. Phase 2 of the extended protocol is as follows:

Phase Two. If the coordinator received at least one “aborting” vote during Phase 1, it decides to abort, deallocates the transaction record from its volatile memory, sends an abort message to all cohorts that voted “ready,” and terminates the
protocol. If all votes are “ready,” the coordinator enters its uncertain period, forces a willing to commit record (which contains a copy of the transaction record) to its log, and sends a commit message to each cohort. Note that the transaction is
not yet committed.
If a cohort receives an abort message, it decides to abort, rolls back any changes it made to the database, appends an abort record to its log, releases all locks, and terminates. If a cohort receives a commit message, it decides to commit, forces a commit record to its log, releases all locks, sends a done message to the coordinator, and terminates the protocol.
The coordinator waits until it receives the first done message from a cohort. Then it decides to commit, forces a commit record to its log, and waits until it receives a done message from all cohorts. Then it writes a completion record to its log, deletes the transaction record from its volatile memory, and terminates.
Describe timeout and restart procedures for this protocol. Showthat this protocol blocks only when the coordinator and at least one cohort crash (or a partition occurs) or when all cohorts crash. Give an example where the transaction aborts even though all cohorts voted “ready.”

What will be an ideal response?

The uncertain period for a cohort starts when it votes and ends when it receives a commit or abort message. If a cohort times out or is restarted in its uncertain period, it first sttempts to contact the coordinator (as in the conventional two-phase commit) or one of the cohorts. If any have decided, it makes the same decision. If it can contact all the cohorts and none have decided, all decide abort. (This is the situation where the transaction aborts even though all the cohorts voted ready.) If it cannot contact all the cohorts and all cohorts it can contact are undecided, it blocks. (Blocking occurs only when the coordinator and at least one cohort has crashed or there is a partition.)
The uncertain period for the coordinator starts when it sends its first commit message and ends when it receives its first done message. If the coordinator times out or is restarted in its uncertain period, it checks its log. If it does not find a willing
to commit record, it terminates the protocol. If it does find such a record, it sends commit messages to all cohorts listed in the contained transaction record. If a cohort has already decided commit, it responds with a done message and the coordinator
commits; if it has decided abort it informs the coordinator that it has aborted and the coordinator aborts. If the coordinator cannot contact a cohort that has decided, it blocks. (Blocking occurs only when all cohorts have crashed or there is a partition.)

Computer Science & Information Technology

You might also like to view...

A ZTI deployment allows a computer to be reimaged from a remote location

Indicate whether the statement is true or false

Computer Science & Information Technology

Which of the following log analysis techniques compares the log entries against a set of known bad activity?

A. Trend analysis B. Signature analysis C. Correlation analysis D. Sequencing analysis

Computer Science & Information Technology