Skip to content

Commit

Permalink
Added CS 162 lec 23 part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
hrushikeshrv committed May 27, 2024
1 parent 03d5f17 commit d66c9a7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 25 deletions.
16 changes: 0 additions & 16 deletions 6.041/index.md

This file was deleted.

8 changes: 0 additions & 8 deletions 6.041/lec2.md

This file was deleted.

15 changes: 14 additions & 1 deletion CS162/lec23.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,17 @@ The high-level overview of the algorithm is -

All workers and the coordinator have an internal log in which they record their decision so that they will remember their decision even after a crash.

![2PC algorithm](./media/lec23-2.png)
![2PC algorithm](./media/lec23-2.png)

A key drawback of the 2PC algorithm is that it is blocking. If a node fails or keeps failing, the other nodes are blocked and cannot make progress. A blocked node can also hold resources like locks, which make the blocking problem worse. There are some alternatives to the 2PC algorithm, such as the 3 phase commit, which has 3 phases instead of 2, PAXOS, a complicated distributed decision making algorithm used by Google in its internal systems, etc.

Another limitation of the 2PC algorithm (and also the alternatives to it) is that it assumes all nodes are working correctly, and no node is malicious. If a distributed system can have malicious nodes, you need a different class of algorithms. This situation is demonstrated by the Byzantine general's problem.

## Byzantine General's Problem
The Byzantine general's problem has n players (nodes), out of which one or more can be malicious. One of the nodes is the General (leader), and has to send a boolean message to all nodes. The outcome must be that all correctly working nodes perform the same action, regardless of how the malicious nodes try to throw them off.

![Byzantine General's Problem](./media/lec23-3.png)

The leader itself could be compromised. In this case, all the correctly functioning nodes still perform the same action, but that action may not be what the leader communicates to each node.

The lecture doesn't actually describe the algorithms that solve this problem, but today's algorithms are $ O(n^2) $, and block chain based algorithms can even be $ O(n) $ in the number of messages that need to be exchanged between the nodes.
Binary file added CS162/media/lec23-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d66c9a7

Please sign in to comment.