Skip to content

Commit

Permalink
RDB version signature bumped to 2, now that direct saving of speciall…
Browse files Browse the repository at this point in the history
…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 6b52ad8
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 @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6b52ad8

Please sign in to comment.