antirez/redis — pull request #1744 by mattsta (2014-05-12 17:50:38+00:00)
Title: Improve Loading RDB Failure Action

This is a first attempt at automatically running `redis-check-rdb` when RDB fails to load.

Currently, when an RDB fails to load, Redis prints a stack trace telling the user to report the issue on GitHub, but we know the problem is corrupt data, not corrupt code.

I've attempted a fix with some changes:
- rename `redis-check-dump` to `redis-check-rdb` (matches `redis-check-aof` better now too)
- convert `redis-check-rdb` into a mode of Redis (like how Sentinel is a mode of Redis)
- If RDB is defined in your config, you can run `redis-server redis.conf --check-rdb` and it will read the RDB defined in redis.conf
- This changes the usage of `redis-check-rdb` to no longer accept a filename though. The filename must be passed with `--dbfilename ` if you are checking something not defined in your config (or something other than the default name of `dump.rdb`).
- Also, removes all redundancy from the old `redis-check-dump` that copy/pasted many Redis defines. Some of the copy/pasted defines didn't match the defines in Redis anymore, so wrong values were being compared.
- with `redis-check-rdb` living inside Redis, now we can automatically run `redis-check-rdb` when the RDB fails to load (for duplicate keys or bad encodings). The user will see immediate details about why their RDB can't load instead of just seeing a scary stack trace.