Skip to content

Commit 2ab62b8

Browse files
authored
Merge pull request #412 from codecrafters-io/TropicolX-patch-57
Revise "Receive handshake (1/2) #fj0" (stage 50)
2 parents 5d189ed + 9310d04 commit 2ab62b8

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
In this stage, we'll start implementing support for receiving a replication handshake as a master.
22

3-
### Handshake (continued from previous stage)
3+
### Handshake (Recap)
44

5-
We'll now implement the same handshake we did in the previous stages, but on the master instead of the replica.
5+
Up until now, we've been implementing the handshake from the replica's perspective. Now we'll implement the same handshake on the master side.
66

7-
As a recap, there are three parts to the handshake:
7+
As a recap, the master receives the following from the replica during the handshake:
88

9-
- The master receives a `PING` from the replica
10-
- Your Redis server already supports the `PING` command, so there's no additional work to do here
11-
- The master receives `REPLCONF` twice from the replica (**This stage**)
12-
- The master receives `PSYNC` from the replica (Next stage)
9+
1. A `PING` command
10+
2. Two `REPLCONF` commands
11+
3. A `PSYNC` command
1312

14-
In this stage, you'll add support for receiving the `REPLCONF` command from the replica.
13+
Your Redis server already supports the `PING` command, so there's no additional work to do for the first step.
1514

16-
You'll receive `REPLCONF` twice from the replica. For the purposes of this challenge, you can safely ignore the arguments for both commands and just
17-
respond with `+OK\r\n` ("OK" encoded as a RESP Simple String).
15+
In this stage, you'll add support for receiving the two `REPLCONF` commands as a master.
16+
17+
For the purposes of this challenge, you can safely ignore the arguments for both commands and simply respond with `+OK\r\n`. That's the string `OK` encoded as a [simple string](https://redis.io/docs/latest/develop/reference/protocol-spec/#simple-strings)
1818

1919
### Tests
2020

@@ -24,8 +24,8 @@ The tester will execute your program like this:
2424
./your_program.sh --port <PORT>
2525
```
2626

27-
It'll then send the following commands:
27+
It will then send the following commands:
2828

29-
1. `PING` (expecting `+PONG\r\n` back)
30-
2. `REPLCONF listening-port <PORT>` (expecting `+OK\r\n` back)
31-
3. `REPLCONF capa psync2` (expecting `+OK\r\n` back)
29+
1. `PING` expecting `+PONG\r\n`
30+
2. `REPLCONF listening-port <PORT>` expecting `+OK\r\n`
31+
3. `REPLCONF capa psync2` expecting `+OK\r\n`

0 commit comments

Comments
 (0)