Skip to content

Commit

Permalink
RDB version is no 4, because small hashes are now encoded as ziplists…
Browse files Browse the repository at this point in the history
…, so older versions of Redis will not understand this format.
  • Loading branch information
antirez committed Mar 10, 2012
1 parent 87faf90 commit c7d7d0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ int rdbSave(char *filename) {
}

rioInitWithFile(&rdb,fp);
if (rdbWriteRaw(&rdb,"REDIS0003",9) == -1) goto werr;
if (rdbWriteRaw(&rdb,"REDIS0004",9) == -1) goto werr;

for (j = 0; j < server.dbnum; j++) {
redisDb *db = server.db+j;
Expand Down Expand Up @@ -1023,7 +1023,7 @@ int rdbLoad(char *filename) {
return REDIS_ERR;
}
rdbver = atoi(buf+5);
if (rdbver < 1 || rdbver > 3) {
if (rdbver < 1 || rdbver > 4) {
fclose(fp);
redisLog(REDIS_WARNING,"Can't handle RDB format version %d",rdbver);
errno = EINVAL;
Expand Down

0 comments on commit c7d7d0a

Please sign in to comment.