# RDB checksum mismatch: expected 0x<hex> but got 0x<hex>

- **ID:** `redis/rdb-checksum-mismatch`
- **Domain:** redis
- **Category:** data_error
- **Error Code:** `ERM`
- **Verification:** ai_generated
- **Fix Rate:** 75%

## 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.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Redis 6.2.0 | active | — | — |
| Redis 7.0.0 | active | — | — |
| Redis 7.2.0 | active | — | — |

## Workarounds

1. **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.** (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.
   ```
2. **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.** (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.
   ```
3. **Enable AOF persistence alongside RDB to reduce reliance on RDB. Set appendonly yes in redis.conf and restart.** (85% success)
   ```
   Enable AOF persistence alongside RDB to reduce reliance on RDB. Set appendonly yes in redis.conf and restart.
   ```

## Dead Ends

- **** — Redis will fail to load the same corrupted RDB file again, causing repeated crashes or startup failures. (95% fail)
- **** — RDB files are binary and have a complex structure; manual editing almost always results in further corruption. (99% fail)
- **** — Deleting the RDB file causes total data loss; it is only acceptable if backups exist. (50% fail)
