A transaction that invokes operations at several servers. A transaction that invokes operations at several servers



Yüklə 311 Kb.
tarix29.12.2016
ölçüsü311 Kb.
#3849



A transaction that invokes operations at several servers.

  • A transaction that invokes operations at several servers.



In a distributed environment, a coordinator is needed

  • In a distributed environment, a coordinator is needed

  • Client sends an openTransaction to the coordinator

    • Other servers that manage the objects accessed by the transaction become participants.
    • The coordinator provides a join method interface




Atomicity principle requires that either all the distributed operations of a transaction complete, or all abort.

  • Atomicity principle requires that either all the distributed operations of a transaction complete, or all abort.

  • At some stage, client executes closeTransaction(). Now, atomicity requires that either all participants (remember these are on the server side) and the coordinator commit or all abort.

  • What problem statement is this?



Consensus, but the system is asynchronous!!

  • Consensus, but the system is asynchronous!!

  • So, need to ensure safety property in real-life implementation. Never have some agreeing to commit, and others agreeing to abort.

  • First cut: one-phase commit protocol. The coordinator unilaterally communicates either commit or abort, to all participants (servers) until all acknowledge.

    • Doesn’t work when a participant crashes before receiving this message (partial transaction results that were in memory are lost).
    • Does not allow participant to abort the transaction, e.g., under error conditions.


Consensus, but it’s impossible in asynchronous networks!

  • Consensus, but it’s impossible in asynchronous networks!

  • So, need to ensure safety property in real-life implementation. Never have some committing while others abort. Err on the side of safety.

  • Alternative: Two-phase commit protocol

    • First phase involves coordinator collecting a vote (commit or abort) from each participant
      • Participant stores partial results in permanent storage before voting
    • Now coordinator makes a decision
    • if all participants want to commit and no one has crashed, coordinator multicasts “commit” message
    • else if any participant has crashed or aborted, coordinator multicasts “abort” message to all participants
      • Everyone aborts










Yüklə 311 Kb.

Dostları ilə paylaş:




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin