You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/08-Distributed-Programming-Raft.slide
+5-3Lines changed: 5 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ Terms are not always used consistently.
54
54
* Discussion: How would you solve the problem?
55
55
56
56
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.
58
58
59
59
- Under the assumption of reliable communication.
60
60
- Under the assumption of unreliable communication.
@@ -94,15 +94,17 @@ CP = Cash Machine
94
94
Phases:
95
95
96
96
- 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.
98
98
- 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.
99
99
100
+
This is equivalent with two round trips in the two general problem.
101
+
100
102
* What is Raft?
101
103
- Raft is a protocol for distributed consensus
102
104
- Raft is designed to be easy understandable
103
105
- Raft predecessor Paxos was highly complex
104
106
- 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
106
108
- Zookeeper ZAB is an alternative but more complex solution
107
109
.link https://raft.github.io/raft.pdf The Raft Paper
108
110
.link https://github.com/lshmouse/reading-papers/blob/master/distributed-system/Zab:%20High-performance%20broadcast%20for%0Aprimary-backup%20systems.pdf The ZAB paper
Copy file name to clipboardExpand all lines: docs/exercises/Exercise8.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,11 +35,11 @@ var nodePortList = []string{
35
35
On start of the program the node id should be read as argument from the console.
36
36
```raft --node 0```
37
37
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.
39
39
40
40
### State
41
41
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
43
43
44
44
* Follower
45
45
* Candidate
@@ -84,7 +84,7 @@ If the node is the leader, it should return "no" to the other nodes, otherwise "
84
84
85
85
From now on all nodes start from the follower state. No one is the leader.
86
86
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)
88
88
- Because there is no leader, the nodes become candidates and start an election.
89
89
- The nodes wait for a random time between 1 and 3 seconds and start a voting process.
90
90
- For the voting they send a request to all other nodes to the voting endpoint.
0 commit comments