16 Commits

Author SHA1 Message Date
antirez
0a881fbe91 redis_check_rdb_main(): create shared objects only if needed.
Otherwise Valgrind will complain a memory leak under certain tests where
RDB checking is invoked from within Redis.
2016-07-06 19:06:22 +02:00
antirez
2cb427cf0a Fix redis_check_rdb() return value. 2016-07-06 19:00:43 +02:00
antirez
8b44311d67 In Redis RDB check: log decompression errors. 2016-07-01 11:59:25 +02:00
antirez
363e50eb0c In Redis RDB check: log object type on error. 2016-07-01 11:40:40 +02:00
antirez
3412ff859c In Redis RDB check: minor output message changes. 2016-07-01 09:52:35 +02:00
antirez
a89f5d2bdf In Redis RDB check: better error reporting. 2016-07-01 09:36:52 +02:00
antirez
8fbb0fb0c5 In Redis RDB check: initial POC.
So far we used an external program (later executed within Redis) and
parser in order to check RDB files for correctness. This forces, at each
RDB format update, to have two copies of the same format implementation
that are hard to keep in sync. Morover the former RDB checker only
checked the very high-level format of the file, without actually trying
to load things in memory. Certain corruptions can only be handled by
really loading key-value pairs.

This first commit attempts to unify the Redis RDB loadig code with the
task of checking the RDB file for correctness. More work is needed but
it looks like a sounding direction so far.
2016-06-30 23:44:44 +02:00
Pierre Chapuis
f0d0231473 fix some compiler warnings 2016-06-05 16:48:45 +02:00
antirez
4e37d7d2c8 RDB v8: fix rdbLoadLen() return value. 2016-06-01 20:18:28 +02:00
antirez
c15cac0d77 RDMF: More consistent define names. 2015-07-27 14:37:58 +02:00
antirez
e2b858a580 RDMF: redisLog -> serverLog. 2015-07-26 15:17:43 +02:00
antirez
6a424b5e36 RDMF (Redis/Disque merge friendlyness) refactoring WIP 1. 2015-07-26 15:17:18 +02:00
antirez
97b74dd0a2 Handle redis-check-rdb as a standalone program.
This also makes it backward compatible in the usage, but for the command
name. However the old command name was less obvious so it is worth to
break it probably.

With the new setup the program main can perform argument parsing and
everything else useful for an RDB check regardless of the Redis server
itself.
2015-02-03 10:25:01 +01:00
antirez
0901884379 redis-check-rdb: initialize entry in case while is never entered. 2015-01-30 15:19:39 +01:00
Matt Stancliff
2902fe7597 Remove code duplication from check-rdb
redis-check-rdb (previously redis-check-dump) had every RDB define
copy/pasted from rdb.h and some defines copied from redis.h.  Since
the initial copy, some constants had changed in Redis headers and
check-dump was using incorrect values.

Since check-rdb is now a mode of Redis, the old check-dump code
is cleaned up to:
  - replace all printf with redisLog (and remove \n from all strings)
  - remove all copy/pasted defines to use defines from rdb.h and redis.h
  - replace all malloc/free with zmalloc/zfree
  - remove unnecessary include headers
2015-01-28 11:18:18 -05:00
Matt Stancliff
302a22ad8c Convert check-dump to Redis check-rdb mode
redis-check-dump is now named redis-check-rdb and it runs
as a mode of redis-server instead of an independent binary.

You can now use 'redis-server redis.conf --check-rdb' to check
the RDB defined in redis.conf.  Using argument --check-rdb
checks the RDB and exits.  We could potentially also allow
the server to continue starting if the RDB check succeeds.

This change also enables us to use RDB checking programatically
from inside Redis for certain failure conditions.
2015-01-28 11:18:16 -05:00