ERR
redis
data_error
ai_generated
partial
RDB 校验和不匹配:预期 0xabc123 但实际为 0xdef456,可能检测到数据损坏或双重释放
RDB checksum mismatch: expected 0xabc123 but got 0xdef456, possible data corruption or double-free detected
ID: redis/rdb-load-corrupt-double-free
70%修复率
86%置信度
1证据数
2024-01-05首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 6.2 | active | — | — | — |
| 7.0 | active | — | — | — |
| 7.2 | active | — | — | — |
| 8.0-m3 | active | — | — | — |
根因分析
RDB 文件的校验和与计算值不匹配,表明在写入、传输或存储过程中文件损坏,可能是转储过程中的双重释放内存错误所致。
English
The RDB file's checksum does not match the computed checksum, indicating file corruption during write, transfer, or storage, possibly due to a double-free memory error in the dump process.
官方文档
https://redis.io/docs/latest/operate/oss_admin/persistence/解决方案
-
Use the redis-check-rdb tool to repair the RDB file: redis-check-rdb --fix /path/to/dump.rdb
-
Restore from a known good backup taken before the corruption occurred. Example: copy backup.rdb to dump.rdb and restart Redis.
-
If the corruption is due to memory errors, run memtest on the server hardware and replace faulty RAM, then restore from backup.
无效尝试
常见但无效的做法:
-
Re-run the RDB save command to overwrite the corrupted file.
50% 失败
If the corruption is due to underlying disk or memory issues, the new save may also be corrupted.
-
Use a backup RDB file from a different time without verifying its integrity.
40% 失败
The backup may have the same corruption if it was written during the same problematic period.
-
Disable checksum verification in redis.conf by setting rdbchecksum no.
70% 失败
This ignores the error but does not fix the corruption; loading corrupted data can cause crashes or data loss.