Notice!

Redis can not start up after nfs storage is full, the dump.rdb is in nfs. Is there a way to restore the dump.rdb ? I used redis-check-aof restoring the appendonly.aof, it is ok, but redis-check-rdb can not restore dump.rdb

./bin/redis-check-rdb ./data/dump.rdb [offset 0] Checking RDB file ./data/dump.rdb --- RDB ERROR DETECTED --- [offset 9] Wrong signature trying to load DB from file [additional info] While doing: start [additional info] Reading type 0 (string) [info] 0 keys read [info] 0 expires [info] 0 already expired

Crash report

35572:M 28 Aug 2023 19:09:51.509 # Wrong signature trying to load DB from file 35572:M 28 Aug 2023 19:09:51.509 # Fatal error loading the DB: Invalid argument. Exiting.

Additional information

  1. Centos 7.9
  2. Steps to reproduce (can not)
  3. redis version: 5.0.5

Comment From: bugwz

@WYmindsky redis-check-aof provides the function of repairing AOF, but it is limited to repairing the resp format content in the AOF. The strategy is to truncate data in abnormal formats, so after the repair is completed, your data may have problems. Because RDB stores binary-encoded data, redis-check-rdb cannot repair the data in RDB and can only perform anomaly detection.

You can use the repaired AOF to start redis and regenerate the new RDB file after startup.