summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2016-06-16 15:53:57 +0200
committerantirez <antirez@gmail.com>2016-06-16 15:53:57 +0200
commita3f893b8004bae824a3c1827666ffb0d7e342355 (patch)
treef059bba33ab522ebf7e0d08abd29db33ef90bd54
parent8272ceadaa161989ead1406eecaa17ddd57dbcb7 (diff)
downloadredis-a3f893b8004bae824a3c1827666ffb0d7e342355.tar.gz
RESTORE: accept RDB dumps with older versions.
Reference issue #3218. Checking the code I can't find a reason why the original RESTORE code was so opinionated about restoring only the current version. The code in to `rdb.c` appears to be capable as always to restore data from older versions of Redis, and the only places where it is needed the current version in order to correctly restore data, is while loading the opcodes, not the values itself as it happens in the case of RESTORE. For the above reasons, this commit enables RESTORE to accept older versions of values payloads.
-rw-r--r--src/cluster.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cluster.c b/src/cluster.c
index 1f19db3e4..9289f6782 100644
--- a/src/cluster.c
+++ b/src/cluster.c
@@ -4535,7 +4535,7 @@ int verifyDumpPayload(unsigned char *p, size_t len) {
/* Verify RDB version */
rdbver = (footer[1] << 8) | footer[0];
- if (rdbver != RDB_VERSION) return C_ERR;
+ if (rdbver > RDB_VERSION) return C_ERR;
/* Verify CRC64 */
crc = crc64(0,p,len-8);