Skip to content

Commit 101dd4f

Browse files
authored
Merge pull request #419 from codecrafters-io/TropicolX-patch-64
Revise "Multi-replica propagation #hd5" (stage 54)
2 parents 6229790 + 443d87d commit 101dd4f

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
In this stage, you'll extend your implementation of the master to support propagating commands to multiple replicas.
22

3+
### Command Propagation (Recap)
4+
5+
Once a replica completes the handshake and loads the RDB file, it is ready to start receiving live updates from the master.
6+
7+
Every write command executed on the master must be forwarded to all connected replicas, not just one. This ensures that every replica stays in sync with the master.
8+
39
### Tests
410

511
The tester will execute your program like this:
@@ -8,21 +14,14 @@ The tester will execute your program like this:
814
./your_program.sh --port <PORT>
915
```
1016

11-
It'll then start **multiple** replicas that connect to your server and execute the following commands:
12-
13-
1. `PING` (expecting `+PONG\r\n` back)
14-
2. `REPLCONF listening-port <PORT>` (expecting `+OK\r\n` back)
15-
3. `REPLCONF capa psync2` (expecting `+OK\r\n` back)
16-
4. `PSYNC ? -1` (expecting `+FULLRESYNC <REPL_ID> 0\r\n` back)
17-
18-
Each replica will expect to receive an RDB file from the master after the handshake is complete.
17+
It will then start **multiple** replicas that will each connect to your server, complete the handshake, and receive the initial RDB file.
1918

20-
It'll then send `SET` commands to the master from a client (a separate Redis client, not the replicas).
19+
Next, the tester will send `SET` commands to the master from a separate client.
2120

2221
```bash
2322
$ redis-cli SET foo 1
2423
$ redis-cli SET bar 2
2524
$ redis-cli SET baz 3
2625
```
2726

28-
It'll then assert that each replica received those commands, in order.
27+
It will then assert that each replica received those commands in the correct order.

0 commit comments

Comments
 (0)