Consensus on Transaction Commit

2019-03-19  本文已影响0人  56c04c992e96

1. Introduction

A distributed transaction is performed at multiple sites, terminated by a request to commit or abort (the intension). The sites then use a transaction commit protocol to decided whether to commit or abort (the actual result).

Focus on atomicity: all or nothing is committed on the sites.

2. Transaction Commit

A distributed transaction is performed by a collection of processes called resource managers (RM).

For the transaction to be committed, each RM must be willing to commit it (必要不充分).

Each RM begins in a working state. The goal of the protocol is for the RMs all to reach a committed or aborted state.

Two requirements:

As a result, once an RM enters committed, no other RM can enter aborted, and vice versa.

In addition, each RM also has a prepared state. Requirement:

So for a transaction to be able to commit, these sequence of events must happen:

  1. All RMs enter the prepared state, in any order
  2. All RMs enter the committed state, in any order

At last, an RM is allowed to enter aborted directly from working state.

The predicated mentioned earlier:

上一篇下一篇

猜你喜欢

热点阅读