Skip to content
Snippets Groups Projects
Commit 12558fc3 authored by Peter J. Keleher's avatar Peter J. Keleher
Browse files

auto

parent 8359ceb2
No related branches found
No related tags found
No related merge requests found
# RAFT # RAFT
**v1.1** **v1.11**
## Due: Nov 19, 2023, 11:59:59 pm ## Due: Nov 19, 2023, 11:59:59 pm
Latest changes:
- Follower replica getting a command request should forward to the
leader (and wait). The incoming context should be used in the
forward. This change should took about two lines of code.
## Setup ## Setup
Download files [here](https://sedna.cs.umd.edu/818/projects/p5.tgz?1). Download files [here](https://sedna.cs.umd.edu/818/projects/p5.tgz?1).
...@@ -55,8 +60,11 @@ Your servers and clients are called as follows: ...@@ -55,8 +60,11 @@ Your servers and clients are called as follows:
of the system and the command is a simple uninterpreted string. of the system and the command is a simple uninterpreted string.
For example: `go run client.go For example: `go run client.go
localhost:8002 one` submits the command "one" to localhost:8002 one` submits the command "one" to
`localhost:8002`. If this host is not the leader it returns *false* `localhost:8002`. If this host is not the leader, the request should
to the client, which prints this out. The RPC to the server will not be forwarded to the true leader using the same context. So the
client will be waiting on the local raft gothread, which is waiting
on the remote replica gothread, which is waiting on the channel that
will be activated when the command commits. The RPC to the server will not
return until the command is committed, at which point the client return until the command is committed, at which point the client
will print out "true". will print out "true".
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment