Skip to content

Commit 96cf25c

Browse files
authored
Fix command syntax and enhance offset explanation
Updated command syntax and clarified offset response requirements.
1 parent f2ffba5 commit 96cf25c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

stage_descriptions/replication-15-yd3.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,21 @@ Just like in the previous stages, your replica should complete the handshake wit
3838
The master will then propagate a series of commands to your replica. These commands will be interleaved with `REPLCONF GETACK *` commands.
3939

4040
```bash
41-
REPLCONF getack * # expect: REPLCONF ACK 0
41+
REPLCONF GETACK * # expect: REPLCONF ACK 0
4242

4343
PING # replica processes silently
44-
REPLCONF getack * # expect: REPLCONF ACK 51
44+
REPLCONF GETACK * # expect: REPLCONF ACK 51
4545
# 51 = 37 (first REPLCONF) + 14 (PING)
4646

4747
SET foo 1 # replica processes silently
4848
SET bar 2 # replica processes silently
49-
REPLCONF getack * # expect: REPLCONF ACK 146
49+
REPLCONF GETACK * # expect: REPLCONF ACK 146
5050
# 146 = 51 + 37 (second REPLCONF) + 29 (SET foo) + 29 (SET bar)
5151
```
5252

53-
Your replica must calculate and return the exact offset at each step.
53+
Your replica must calculate and return the exact offset at each step in the `REPLCONF ACK <offset>` response. Your response should also be encoded as a [RESP array](https://redis.io/docs/latest/develop/reference/protocol-spec/#arrays).
5454

5555
### Notes
5656

5757
- The offset should only include the number of bytes of commands processed **before** receiving the current `REPLCONF GETACK` command.
5858
- Although masters don't propagate `PING` commands when received from clients (since they aren't "write" commands), they may send `PING` commands to replicas to notify replicas that the master is still alive.
59-
- The response should be encoded as a [RESP array](https://redis.io/docs/latest/develop/reference/protocol-spec/#arrays).

0 commit comments

Comments
 (0)