ERM
redis
data_error
ai_generated
partial
RDB checksum mismatch: expected 0x<hex> but got 0x<hex>
ID: redis/rdb-checksum-mismatch
75%Fix Rate
92%Confidence
1Evidence
2023-06-12First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| Redis 6.2.0 | active | — | — | — |
| Redis 7.0.0 | active | — | — | — |
| Redis 7.2.0 | active | — | — | — |
Root Cause
The RDB file on disk has been corrupted or truncated, causing its checksum to not match the expected value calculated by Redis during loading.
generic中文
磁盘上的 RDB 文件已损坏或被截断,导致其校验和与 Redis 加载时计算的值不匹配。
Official Documentation
https://redis.io/docs/latest/operate/oss_and_stack/management/persistence/Workarounds
-
90% success Restore from a recent backup RDB file: copy the backup to the dump directory and restart Redis. Example: cp /backup/dump.rdb /var/lib/redis/dump.rdb; systemctl restart redis.
Restore from a recent backup RDB file: copy the backup to the dump directory and restart Redis. Example: cp /backup/dump.rdb /var/lib/redis/dump.rdb; systemctl restart redis.
-
75% success Use redis-check-rdb to repair the file: run redis-check-rdb /var/lib/redis/dump.rdb to fix minor corruption. If unrecoverable, use AOF file as fallback if enabled.
Use redis-check-rdb to repair the file: run redis-check-rdb /var/lib/redis/dump.rdb to fix minor corruption. If unrecoverable, use AOF file as fallback if enabled.
-
85% success Enable AOF persistence alongside RDB to reduce reliance on RDB. Set appendonly yes in redis.conf and restart.
Enable AOF persistence alongside RDB to reduce reliance on RDB. Set appendonly yes in redis.conf and restart.
中文步骤
Restore from a recent backup RDB file: copy the backup to the dump directory and restart Redis. Example: cp /backup/dump.rdb /var/lib/redis/dump.rdb; systemctl restart redis.
Use redis-check-rdb to repair the file: run redis-check-rdb /var/lib/redis/dump.rdb to fix minor corruption. If unrecoverable, use AOF file as fallback if enabled.
Enable AOF persistence alongside RDB to reduce reliance on RDB. Set appendonly yes in redis.conf and restart.
Dead Ends
Common approaches that don't work:
-
95% fail
Redis will fail to load the same corrupted RDB file again, causing repeated crashes or startup failures.
-
99% fail
RDB files are binary and have a complex structure; manual editing almost always results in further corruption.
-
50% fail
Deleting the RDB file causes total data loss; it is only acceptable if backups exist.