Permalink
Browse files

RDB version signature bumped to 2, now that direct saving of speciall…

…y encoded types is implemented 2.2 instances are no longer able to read rdb files produced by 2.4 or unstable.
  • Loading branch information...
antirez committed May 10, 2011
1 parent 4b53e73 commit 6b52ad87c05ca2162a2d21f1f5b5329bf52a7678
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/rdb.c
View
@@ -425,7 +425,7 @@ int rdbSave(char *filename) {
strerror(errno));
return REDIS_ERR;
}
if (fwrite("REDIS0001",9,1,fp) == 0) goto werr;
if (fwrite("REDIS0002",9,1,fp) == 0) goto werr;
for (j = 0; j < server.dbnum; j++) {
redisDb *db = server.db+j;
dict *d = db->dict;
@@ -931,7 +931,7 @@ int rdbLoad(char *filename) {
return REDIS_ERR;
}
rdbver = atoi(buf+5);
if (rdbver != 1) {
if (rdbver < 1 || rdbver > 2) {
fclose(fp);
redisLog(REDIS_WARNING,"Can't handle RDB format version %d",rdbver);
return REDIS_ERR;

0 comments on commit 6b52ad8

Please sign in to comment.