I have two isolated redis instances running which are both seemingly writing corrupted snapshots all of a sudden. The keys inside seem ok when I query their contents in the running server but both the AOF and RDB has CRC errors according to the redis-check-rdb/aof commands. The redis server logs seem normal with no error indications. I copied the snapshot to a different server and started redis with the snapshot. Redis did not complain and keys seem to be intact.
# redis-check-aof appendonly.aof
The AOF appears to start with an RDB preamble.
Checking the RDB preamble to start:
[offset 0] Checking RDB file appendonly.aof
[offset 26] AUX FIELD redis-ver = '6.0.1'
[offset 40] AUX FIELD redis-bits = '64'
[offset 52] AUX FIELD ctime = '1589533018'
[offset 67] AUX FIELD used-mem = '2535888'
[offset 83] AUX FIELD aof-preamble = '1'
[offset 85] Selecting DB ID 0
--- RDB ERROR DETECTED ---
[offset 21580] RDB CRC error
[additional info] While doing: check-sum
[info] 8 keys read
[info] 0 expires
[info] 0 already expired
RDB preamble of AOF file is not sane, aborting.
# redis-check-rdb dump.rdb
[offset 0] Checking RDB file dump.rdb
[offset 26] AUX FIELD redis-ver = '6.0.1'
[offset 40] AUX FIELD redis-bits = '64'
[offset 52] AUX FIELD ctime = '1589533467'
[offset 67] AUX FIELD used-mem = '2516040'
[offset 83] AUX FIELD aof-preamble = '0'
[offset 85] Selecting DB ID 0
--- RDB ERROR DETECTED ---
[offset 21580] RDB CRC error
[additional info] While doing: check-sum
[info] 8 keys read
[info] 0 expires
[info] 0 already expired
The dump.rdb file is exactly 21580 bytes.
Redis log excerpt:
972:M 15 May 2020 10:55:16.034 * 1 changes in 900 seconds. Saving...
972:M 15 May 2020 10:55:16.035 * Background saving started by pid 125050
125050:C 15 May 2020 10:55:16.038 * DB saved on disk
125050:C 15 May 2020 10:55:16.039 * RDB: 2 MB of memory used by copy-on-write
972:M 15 May 2020 10:55:16.135 * Background saving terminated with success
972:M 15 May 2020 10:56:58.963 * Background append only file rewriting started by pid 125092
972:M 15 May 2020 10:56:58.986 * AOF rewrite child asks to stop sending diffs.
125092:C 15 May 2020 10:56:58.987 * Parent agreed to stop sending diffs. Finalizing AOF...
125092:C 15 May 2020 10:56:58.987 * Concatenating 0.00 MB of AOF diff received from parent.
125092:C 15 May 2020 10:56:58.987 * SYNC append only file rewrite performed
125092:C 15 May 2020 10:56:58.988 * AOF rewrite: 2 MB of memory used by copy-on-write
972:M 15 May 2020 10:56:59.055 * Background AOF rewrite terminated with success
972:M 15 May 2020 10:56:59.055 * Residual parent diff successfully flushed to the rewritten AOF (0.00 MB)
972:M 15 May 2020 10:56:59.055 * Background AOF rewrite finished successfully
972:M 15 May 2020 10:57:00.764 * DB saved on disk
972:M 15 May 2020 11:02:01.070 * 10 changes in 300 seconds. Saving...
972:M 15 May 2020 11:02:01.073 * Background saving started by pid 125230
125230:C 15 May 2020 11:02:01.076 * DB saved on disk
125230:C 15 May 2020 11:02:01.077 * RDB: 8 MB of memory used by copy-on-write
972:M 15 May 2020 11:02:01.174 * Background saving terminated with success
972:M 15 May 2020 11:04:27.214 * DB saved on disk
972:M 15 May 2020 11:10:09.701 * DB saved on disk
Server info
# redis-server --version
Redis server v=6.0.1 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=0
# yum info redis
Loaded plugins: fastestmirror, rhnplugin
This system is receiving updates from RHN Classic or Red Hat Satellite.
Loading mirror speeds from cached hostfile
Installed Packages
Name : redis
Arch : x86_64
Version : 6.0.1
Release : 1.el7.remi
# cat /etc/centos-release
CentOS Linux release 7.8.2003 (Core)
Comment From: oranagra
This is a dup of https://github.com/antirez/redis/issues/7187 (fix will be in the next release)
Comment From: taisph
Oh for cr... I only searched open issues for anything related to CRC errors. Sorry about that.