Quorum-based voting

In a distributed database system, a transaction could be executing its operation at multiple sites. Since atomicity requires every distributed transaction to be atomic, the transaction must have the same fate (commit or abort) at every site. In case of network partitioning, sites are partitioned and the partitions may not be able to communicate with each other. This is where a quorum-based technique comes in. The fundamental idea is that a transaction is executed if the majority of sites vote to execute it.

Every site in the system is assigned a vote Vi, Let us assume that the total number of votes in the system is V and the abort and commit quorums are Va and Vc respectively. Then the following rules must be obeyed in the implementation of the commit protocol:

  1. Va + Vc > V, where 0 < Vc, Va <= V

  2. Before a transaction commits, it must obtain a commit quorum Vc. The total of at least one site that is prepared to commit and zero or more sites waiting >=Vc

  3. Before a transaction aborts, it must obtain an abort quorum Va. The total of zero or more sites that are prepared to abort or any site waiting >= Va

The first rule ensures that transaction cannot be committed and aborted at the same time. The next two rules indicate the votes that a transaction has to obtain before it can terminate on way or the other.

你可能感兴趣的:(分布式计算)