Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions stage_descriptions/replication-16-my8.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ In this stage, you’ll implement support for the `WAIT` command on the master.

### The `WAIT` command

The `WAIT` command is used to check how many replicas have acknowledged a write command. This allows a client to measure the durability of a write command before considering it successful.
The `WAIT` command is used to check how many replicas have acknowledged all previous write commands. This allows a client to measure the durability of a write command before considering it successful.

The command format is:
The command format is:

```bash
WAIT <numreplicas> <timeout>
```

Here's what each argument means:

- `<numreplicas>`: The minimum number of replicas that must acknowledge the write command.
- `<numreplicas>`: The minimum number of replicas that must acknowledge all previous write commands.
- `<timeout>`: The maximum time (in milliseconds) the client is willing to wait.

For example:
Expand Down
5 changes: 3 additions & 2 deletions stage_descriptions/replication-18-na2.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ In this stage, you’ll extend your `WAIT` implementation to handle the case whe
### `WAIT` with propagated commands

In previous stages, we handled the cases where:

- No replicas were connected, and the master could safely return `0`.
- Replicas were connected, but hadn't received any write commands.

Expand All @@ -12,10 +13,10 @@ To do this, the master must send `REPLCONF GETACK *` to replicas if there are pe

The `WAIT` command should complete when either:

- The required number of replicas has acknowledged the last write command, or
- The required number of replicas has acknowledged all previous write commands, or
- The timeout expires.

Either way, the master should return the number of replicas that acknowledged the command as a [RESP integer](https://redis.io/docs/latest/develop/reference/protocol-spec/#integers).
Either way, the master should return the number of replicas that acknowledged all previous write commands as a [RESP integer](https://redis.io/docs/latest/develop/reference/protocol-spec/#integers).

### Tests

Expand Down
Loading