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
In this stage, we'll start implementing support for receiving a replication handshake as a master.
2
2
3
-
### Handshake (continued from previous stage)
3
+
### Handshake (Recap)
4
4
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.
6
6
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:
8
8
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
13
12
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.
15
14
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)
18
18
19
19
### Tests
20
20
@@ -24,8 +24,8 @@ The tester will execute your program like this:
0 commit comments