Skip to content

Commit c3f9b2f

Browse files
committed
Prepare next lecture: Distributed Computing
1 parent 5cd38e7 commit c3f9b2f

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

docs/08-Distributed-Programming-Raft.slide

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Terms are not always used consistently.
5454
* Discussion: How would you solve the problem?
5555

5656
Three armies, each led by a general, plan to attack a fortified city. The armies may arrive at different times to surround the city, and none of the generals can be certain whether all the armies will arrive at all. Consequently, they have not appointed a single leader.
57-
For the attack to succeed, at least two armies must strike simultaneously. Therefore, the generals need to coordinate and agree on a precise time to launch the attack.
57+
For the attack to succeed, at least two armies must strike simultaneously. Therefore, the generals need to coordinate and agree on a precise time to launch the attack. They can only communicate by sending messengers.
5858

5959
- Under the assumption of reliable communication.
6060
- Under the assumption of unreliable communication.
@@ -94,15 +94,17 @@ CP = Cash Machine
9494
Phases:
9595

9696
- Prepare Phase - Data is persisted on all members. Data is not visible but stored.
97-
- Commit Phase - Persisted data will be loaded into memory. Data gets visible.
97+
- Commit Phase - Persisted data will be executed. Data gets visible.
9898
- This is typically implemented with an append only log (transaction log) and a state machine which reads the log entries and loads them into memory.
9999

100+
This is equivalent with two round trips in the two general problem.
101+
100102
* What is Raft?
101103
- Raft is a protocol for distributed consensus
102104
- Raft is designed to be easy understandable
103105
- Raft predecessor Paxos was highly complex
104106
- Most Paxos implementations are buggy or academic
105-
- Raft was developed 2014 in a phd thesis at Stanford University
107+
- Raft was developed 2014 in a PhD thesis at Stanford University
106108
- Zookeeper ZAB is an alternative but more complex solution
107109
.link https://raft.github.io/raft.pdf The Raft Paper
108110
.link https://github.com/lshmouse/reading-papers/blob/master/distributed-system/Zab:%20High-performance%20broadcast%20for%0Aprimary-backup%20systems.pdf The ZAB paper

docs/exercises/Exercise8.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ var nodePortList = []string{
3535
On start of the program the node id should be read as argument from the console.
3636
```raft --node 0```
3737

38-
Use the `flag` [package](https://pkg.go.dev/flag) to read the arguments.
38+
Use the `flag` [https://pkg.go.dev/flag](package) to read the arguments.
3939

4040
### State
4141

42-
Define an [enum](https://gobyexample.com/enums] containin) for the node state
42+
Define an [https://gobyexample.com/enums](enum) for the node state
4343

4444
* Follower
4545
* Candidate
@@ -84,7 +84,7 @@ If the node is the leader, it should return "no" to the other nodes, otherwise "
8484

8585
From now on all nodes start from the follower state. No one is the leader.
8686

87-
- The nodes wait for heartbeats from the leader. E.g. for two seconds.(Example via the time.After function: [heartbeat.go](../../src/distributed/byzantine/heartbeat.go))
87+
- The nodes wait for heartbeats from the leader. E.g. for two seconds.(Example via the time.After function: [main.go](../../src/concurrent/channels/timeout/main.go)
8888
- Because there is no leader, the nodes become candidates and start an election.
8989
- The nodes wait for a random time between 1 and 3 seconds and start a voting process.
9090
- For the voting they send a request to all other nodes to the voting endpoint.

0 commit comments

Comments
 (0)