fixed two diskstore issues, a quasi-deadlock creating problems with I/O speed and a race condition among threads

This commit is contained in:
antirez
2011-02-11 11:16:15 +01:00
parent 9c104c6886
commit 05600eb8a7
5 changed files with 37 additions and 21 deletions

View File

@ -183,7 +183,7 @@ int dsKeyToPath(redisDb *db, char *buf, robj *key) {
return (buf-origbuf)+41;
}
int dsSet(redisDb *db, robj *key, robj *val) {
int dsSet(redisDb *db, robj *key, robj *val, time_t expire) {
char buf[1024], buf2[1024];
FILE *fp;
int retval, len;
@ -201,7 +201,7 @@ int dsSet(redisDb *db, robj *key, robj *val) {
redisPanic("Unrecoverable diskstore error. Exiting.");
}
}
if ((retval = rdbSaveKeyValuePair(fp,db,key,val,time(NULL))) == -1)
if ((retval = rdbSaveKeyValuePair(fp,key,val,expire,time(NULL))) == -1)
return REDIS_ERR;
fclose(fp);
if (retval == 0) {