From 8a6ace6b4f457691f74c92c7c5711a8ad91eb416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=82=8E=E6=B3=BC?= Date: Mon, 18 Dec 2023 13:32:53 +0800 Subject: [PATCH] Add: en version of paxos-partial-order-rnd --- README.md | 2 +- .../paxos-partial-order-rnd.md | 28 +++++++------------ 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 53f5e47..089d5e0 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ This repo is a list of distributed consensus protocol's bugs, flaws, deceptive t - [Paxos: (Trap): The Bug in Paxos Made Simple](src/list/classic-paxos-forget-decided-value/classic-paxos-forget-decided-value.md) | ๐ŸŒŽ [ไธญๆ–‡็‰ˆ](src/list/classic-paxos-forget-decided-value/classic-paxos-forget-decided-value.cn.md) - [Paxos: (Optimize): Asymmetric Acceptors](src/list/asymmetric-paxos/asymmetric-paxos.md) | ๐ŸŒŽ [ไธญๆ–‡็‰ˆ](src/list/asymmetric-paxos/asymmetric-paxos.cn.md) - Paxos/Raft: (Generalize): ๅ…่ฎธๆœชๅ‘็”Ÿไบ‹ไปถ็š„ๆ—ถ้—ดๅ›ž้€€ | ๐ŸŒŽ [ไธญๆ–‡็‰ˆ](src/list/paxos-revert-rnd/paxos-revert-rnd.md) -- Paxos: (Generalize): Partial Order Round Number = Paxos + 2PC | ๐ŸŒŽ [ไธญๆ–‡็‰ˆ](src/list/paxos-partial-order-rnd/paxos-partial-order-rnd.cn.md) +- [Paxos: (Generalize): Partial Order Round Number = Paxos + 2PC](src/list/paxos-partial-order-rnd/paxos-partial-order-rnd.md) | ๐ŸŒŽ [ไธญๆ–‡็‰ˆ](src/list/paxos-partial-order-rnd/paxos-partial-order-rnd.cn.md) - [Raft: (Suboptimal): Leader Step Down](src/list/raft-leader-step-down/raft-leader-step-down.md) - [Raft: (Optimize): ReadIndex: Less Wait](src/list/raft-read-index/raft-read-index.md) | ๐ŸŒŽ [ไธญๆ–‡็‰ˆ](src/list/raft-read-index/raft-read-index.cn.md) diff --git a/src/list/paxos-partial-order-rnd/paxos-partial-order-rnd.md b/src/list/paxos-partial-order-rnd/paxos-partial-order-rnd.md index 4a94d27..80a990c 100644 --- a/src/list/paxos-partial-order-rnd/paxos-partial-order-rnd.md +++ b/src/list/paxos-partial-order-rnd/paxos-partial-order-rnd.md @@ -1,28 +1,20 @@ -## Paxos: (Generalization): Partial Order Round Number = Paxos + 2PC +## Paxos: (Generalize): Partial Order Round Number = Paxos + 2PC -[Paxos](https://en.wikipedia.org/wiki/Paxos_(computer_science)) phase-1 requires a Proposer to produce an **integer** n to serve as `rnd`. -In fact, the definition of `rnd` can be generalized from an integer to any value of a [partially ordered set](https://en.wikipedia.org/wiki/Partially_ordered_set), and it can still satisfy the correctness of Paxos because the main use in Paxos is the property of the **size relationship** of `rnd`. +[Paxos](https://en.wikipedia.org/wiki/Paxos_(computer_science)) is a protocol where, during phase-1, a Proposer must generate an integer value `n` as the `rnd` number. However, this definition can be expanded beyond integers. By using any value from a [partially ordered set](https://en.wikipedia.org/wiki/Partially_ordered_set), the essential ordering property of `rnd` in Paxos is still preserved, which is critical for the protocol's correctness. -Using a partially ordered `rnd` in Paxos, -one can choose either **mandatory** conflict exclusion (similar to [2PC](https://en.wikipedia.org/wiki/Two-phase_commit_protocol)) -or **non-mandatory** conflict exclusion (similar to Paxos's livelock) to implement the safety requirements of the consensus protocol. +In a generalized Paxos, the `rnd` can employ a partial order, allowing for a choice between **mandatory** conflict exclusion, akin to the [Two-Phase Commit Protocol (2PC)](https://en.wikipedia.org/wiki/Two-phase_commit_protocol), and **non-mandatory** conflict exclusion, reminiscent of the potential for livelock in Paxos, to uphold the safety of the consensus process. -For example, choosing the **divisibility** partial order relationship to implement Paxos, define `rnd` as a positive integer, -size relationship definition: **if a divides b, then a is less than b**: -in this case, we have: `1 < 2 < 6`, `1 < 3 < 6`, but `2 โ‰ฎ 3`. -In the following example, after Proposer P2 completes phase-1, P3 cannot complete phase-1 because on Acceptor A2, `3 โ‰ฏ 2`, thus abandoning P3, using P6 to complete phase-1, and then completing phase-2 to achieve a commit. +Consider the **divisibility** as a partial ordering criterion in Paxos, where `rnd` is a positive integer, and the order is determined by divisibility: **if a divides b, then a is less than b**. For example, we have `1 < 2 < 6`, and `1 < 3 < 6`, but `2` is not comparable to `3`. In a scenario where Proposer P2 has finished phase-1, P3 cannot proceed because `3 โ‰ฏ 2` on Acceptor A2. Therefore, P3 quits and P6 can initiate phase-1 and proceed to phase-2, ultimately commit a value. ![](paxos-partial-order-rnd.jpeg) -**In application**, the partial order `rnd` provides a very large extension space for consistency algorithms like Paxos, -it extends the one-dimensional sequence relationship to a multi-dimensional sequence relationship (similar to multi-dimensional time). +In practical applications, the concept of a partial order `rnd` greatly expands the possibilities for consistency algorithms like Paxos by introducing multi-dimensional ordering, which can be thought of as an analogy to multi-dimensional time. -For instance, in a storage system, one could set up 2 groups of `rnd`: +For instance, in a distributed storage system, one could establish two separate `rnd` groups: -- One group of Proposers only chooses 2โฟ as `rnd`, intending to execute transaction A; -- Another group of Proposers only chooses 3โฟ as `rnd`, intending to execute transaction B; +- One group of Proposers might use powers of 2 for `rnd`, targeting transaction A; +- The other group may use powers of 3 for `rnd`, targeting transaction B. -Thus, these two groups of Proposers are mutually exclusive, ensuring that at most one transaction is successful (avoiding the livelock in Paxos). -Meanwhile, multiple Proposers within a group can form a highly available backup (without the problem of the Coordinator crashing in 2PC). +These two groups operate independently, ensuring that only one transaction can be committed at a time, thus avoiding Paxosโ€™s livelock issues. Additionally, multiple Proposers within the same group can provide redundancy and high availability, without the single point of failure risk inherent in 2PC's Coordinator. -Therefore, **partial order Paxos can provide the transaction exclusivity of 2PC, as well as the fault tolerance of Paxos, and can simplify the two-layer architecture of 2PC + Paxos in distributed DBs (such as Spanner) to a single layer**. +In conclusion, **partial order Paxos cleverly combines the transaction exclusivity of 2PC with the robustness of Paxos. This fusion simplifies the complex two-layer framework found in distributed databases, such as Spanner, into a more streamlined single-layer architecture**.