# RDB checksum mismatch: expected 0xabc123 but got 0xdef456, possible data corruption or double-free detected

- **ID:** `redis/rdb-load-corrupt-double-free`
- **Domain:** redis
- **Category:** data_error
- **Error Code:** `ERR`
- **Verification:** ai_generated
- **Fix Rate:** 70%

## Root Cause

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.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 6.2 | active | — | — |
| 7.0 | active | — | — |
| 7.2 | active | — | — |
| 8.0-m3 | active | — | — |

## Workarounds

1. **Use the redis-check-rdb tool to repair the RDB file: redis-check-rdb --fix /path/to/dump.rdb** (75% success)
   ```
   Use the redis-check-rdb tool to repair the RDB file: redis-check-rdb --fix /path/to/dump.rdb
   ```
2. **Restore from a known good backup taken before the corruption occurred. Example: copy backup.rdb to dump.rdb and restart Redis.** (85% success)
   ```
   Restore from a known good backup taken before the corruption occurred. Example: copy backup.rdb to dump.rdb and restart Redis.
   ```
3. **If the corruption is due to memory errors, run memtest on the server hardware and replace faulty RAM, then restore from backup.** (70% success)
   ```
   If the corruption is due to memory errors, run memtest on the server hardware and replace faulty RAM, then restore from backup.
   ```

## Dead Ends

- **Re-run the RDB save command to overwrite the corrupted file.** — If the corruption is due to underlying disk or memory issues, the new save may also be corrupted. (50% fail)
- **Use a backup RDB file from a different time without verifying its integrity.** — The backup may have the same corruption if it was written during the same problematic period. (40% fail)
- **Disable checksum verification in redis.conf by setting rdbchecksum no.** — This ignores the error but does not fix the corruption; loading corrupted data can cause crashes or data loss. (70% fail)
