Redis persistence recovery

A corrupt Redis AOF may contain newer writes than the last RDB snapshot, so truncation should be a measured recovery decision.

Redis can persist writes in an append-only file and compact them through rewrite. A crash, full disk, incomplete transfer or storage error can leave a truncated command or inconsistent multipart AOF manifest that prevents startup.

Understand the symptom

AOF recovery replays an ordered command history, while RDB represents an earlier point-in-time snapshot.

WHY

What is happening

Recovery must identify Redis version, AOF format, manifest order, last complete command, rewrite history and whether a replica contains a later consistent dataset. Truncating at the last valid command can discard later writes; copying a replica without comparing replication IDs and offsets can select an older history.

What you may see

Symptoms that change the recovery path.

01

Bad file format reading the append only file

Startup reaches an invalid or incomplete command sequence.

02

Unexpected end of file

The final write or transferred file was truncated.

03

AOF manifest references a missing file

A base or incremental component from multipart persistence is absent.

04

RDB loads but recent data is missing

The snapshot predates writes that may exist only in AOF or a replica.

Protect the source

Actions that can make the situation worse.

01

Automatic fix truncates the tail

Everything after the first unrecoverable point can be removed.

02

Starting a replica can change its state

Replication may overwrite a useful copy with the current primary history.

03

AOF rewrite can replace evidence

Compaction creates a new persistence set and can remove the damaged sequence.

Do this now

Safe steps before evaluation.

01

Stop Redis and orchestration

Prevent restart loops, failover, rewrite, expiration churn and replication resynchronization.

02

Copy the persistence set

Preserve manifests, base and incremental AOF files, RDB snapshots and configuration together.

03

Record replication context

Capture node roles, replication IDs, offsets, Sentinel or cluster state and last known write time.

04

Protect the storage

Image or snapshot the volume before filesystem repair or AOF modification.

NEPFOSYS process

How a data-first evaluation proceeds.

01

Persistence timeline mapping

NEPFOSYS compares AOF components, RDB time, replicas and complete command boundaries.

02

Protected replay testing

Candidate AOF endpoints and replica datasets are loaded in isolated copies.

03

Dataset validation

Key counts, types, TTLs and priority application records are checked at the selected endpoint.

A clear next step

Preserve the original device before another repair or recovery attempt.

Start a case with the exact symptoms, incident timeline, prior attempts, encryption details, and the files that matter most. NEPFOSYS will route the case to the appropriate DFW intake or nationwide mail-in path.

Start with a case review

Questions, answered

What customers ask before starting.

What does redis-check-aof --fix do?

It repairs certain format problems, commonly by truncating content after the last valid point. Always preserve the original and review the proposed data loss.

Is the RDB safer than the AOF?

It may be internally consistent but older. The right source depends on snapshot time, AOF integrity and replica state.

Can a replica replace the damaged primary?

Possibly, after comparing replication identity, offset and dataset freshness and preserving the replica before failover.

DFW local · Nationwide mail-in

Protect the device. Start with the facts.

Start my recovery case