# MASTERDOWN: Stale data is not allowed to be served

> The replica lost its link to the primary and, because it is set to refuse stale data, it answers reads with MASTERDOWN instead.

Source: https://sqlly.app/errors/redis/masterdown
Last updated: 2026-11-30
License: Text and data [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) (credit SQLly, sqlly.app); code and SQL snippets [MIT](https://opensource.org/license/mit). [Details](https://sqlly.app/license).
Note: Quoted error message text belongs to its database vendor.

- Error prefix: `MASTERDOWN`
- Category: Cluster and replication

Error message:

```text
MASTERDOWN Link with MASTER is down and replica-serve-stale-data is set to 'no'.
```

## What it means

MASTERDOWN comes from a replica whose link to its primary is down while replica-serve-stale-data is no. Normally a disconnected replica keeps answering reads from the data it already has; with that setting it refuses instead, so clients cannot silently read data that may be minutes old.

The setting exists for caches that must never serve stale content, and it is strict on purpose: while the link is down, read commands fail with this error, including reads of keys that have not changed in days. Writes on the same replica fail with READONLY instead. The fix belongs to the replication link, not to the client.

## Common causes

- The primary is down, restarting, or unreachable from the replica because of a network or firewall change.
- replica-serve-stale-data no is set, which turns an ordinary disconnection into failed reads.
- A failover left this node replicating from an address that no longer exists.

## How to fix it

1. Check the link state and when it was last healthy:

   ```sql
   redis-cli -p 7303 INFO replication | grep -E 'master_link_status|master_last_io|master_host'
   # master_link_status:down
   ```
2. Restore the link. Most cases are a restarted primary or a network change:

   ```sql
   redis-cli -p 7303 REPLICAOF <master-host> 6379
   ```
3. If serving stale data temporarily is acceptable for this cache, allow it until the link returns:

   ```sql
   redis-cli -p 7303 CONFIG SET replica-serve-stale-data yes
   ```

## Reproduce it safely

```sql
redis-server --port 7303 --replicaof 127.0.0.1 6399 --replica-serve-stale-data no --save '' &
redis-cli -p 7303 GET foo
# (error) MASTERDOWN Link with MASTER is down and replica-serve-stale-data is set to 'no'.
```

## How SQLly helps

The master_link_status and master_link_down_since_seconds fields are one INFO replication away in SQLly's editor, and the full MASTERDOWN reply is printed verbatim, so you can tell a stale-data policy problem from a dead primary at a glance.

## Questions

### MASTERDOWN or READONLY: how do they differ?

Both come from replicas. READONLY is a write on a healthy replica. MASTERDOWN is any read on a replica configured to refuse stale data while its link is down. A write to that replica gets READONLY first.

### Which commands still work during MASTERDOWN?

INFO, REPLICAOF and other management commands work; data commands are refused. That is what lets you fix the link in the first place.

## Related errors

- [`READONLY`](https://sqlly.app/errors/redis/readonly): Write rejected on a read only replica
- [`LOADING`](https://sqlly.app/errors/redis/loading): Dataset still loading from disk
- [`connection reset / interrupted`](https://sqlly.app/errors/libsql/connection-interrupted): libSQL: Connection reset or dropped

The code and message text are from the [Redis documentation and source code](https://redis.io/docs/latest/).
