mirror of
https://github.com/fluencelabs/redis
synced 2025-04-11 03:36:05 +00:00
A minor fix and a few debug messages removed
This commit is contained in:
parent
8c5abee892
commit
5de9ad7c85
@ -1,3 +1,4 @@
|
|||||||
|
2010-03-12 Applied the replication bug patch provided by Jeremy Zawodny, removing temp file collision after the slave got the dump.rdb file in the SYNC stage
|
||||||
2010-03-11 Fix for HGET against non Hash type, debug messages used to understand a bit better a corrupted rdb file
|
2010-03-11 Fix for HGET against non Hash type, debug messages used to understand a bit better a corrupted rdb file
|
||||||
2010-03-09 fix: use zmalloc instead of malloc
|
2010-03-09 fix: use zmalloc instead of malloc
|
||||||
2010-03-09 Merged zsetops branch from Pietern
|
2010-03-09 Merged zsetops branch from Pietern
|
||||||
|
8
redis.c
8
redis.c
@ -3487,16 +3487,13 @@ static robj *rdbLoadObject(int type, FILE *fp) {
|
|||||||
o = createZsetObject();
|
o = createZsetObject();
|
||||||
zs = o->ptr;
|
zs = o->ptr;
|
||||||
/* Load every single element of the list/set */
|
/* Load every single element of the list/set */
|
||||||
redisLog(REDIS_DEBUG,"SORTED SET LEN: %zu\n", zsetlen);
|
|
||||||
while(zsetlen--) {
|
while(zsetlen--) {
|
||||||
robj *ele;
|
robj *ele;
|
||||||
double *score = zmalloc(sizeof(double));
|
double *score = zmalloc(sizeof(double));
|
||||||
|
|
||||||
if ((ele = rdbLoadStringObject(fp)) == NULL) return NULL;
|
if ((ele = rdbLoadStringObject(fp)) == NULL) return NULL;
|
||||||
redisLog(REDIS_DEBUG,"ele %s (%d) (%d)\n", (char*)ele->ptr, ftell(fp), zsetlen);
|
|
||||||
tryObjectEncoding(ele);
|
tryObjectEncoding(ele);
|
||||||
if (rdbLoadDoubleValue(fp,score) == -1) return NULL;
|
if (rdbLoadDoubleValue(fp,score) == -1) return NULL;
|
||||||
redisLog(REDIS_DEBUG,"score %.17g\n", *score);
|
|
||||||
dictAdd(zs->dict,ele,score);
|
dictAdd(zs->dict,ele,score);
|
||||||
zslInsert(zs->zsl,*score,ele);
|
zslInsert(zs->zsl,*score,ele);
|
||||||
incrRefCount(ele); /* added to skiplist */
|
incrRefCount(ele); /* added to skiplist */
|
||||||
@ -3544,7 +3541,6 @@ static robj *rdbLoadObject(int type, FILE *fp) {
|
|||||||
} else {
|
} else {
|
||||||
redisAssert(0 != 0);
|
redisAssert(0 != 0);
|
||||||
}
|
}
|
||||||
redisLog(REDIS_DEBUG,"DONE\n");
|
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3599,7 +3595,6 @@ static int rdbLoad(char *filename) {
|
|||||||
}
|
}
|
||||||
/* Read key */
|
/* Read key */
|
||||||
if ((keyobj = rdbLoadStringObject(fp)) == NULL) goto eoferr;
|
if ((keyobj = rdbLoadStringObject(fp)) == NULL) goto eoferr;
|
||||||
redisLog(REDIS_DEBUG,"KEY: %s\n", (char*)keyobj->ptr);
|
|
||||||
/* Read value */
|
/* Read value */
|
||||||
if ((o = rdbLoadObject(type,fp)) == NULL) goto eoferr;
|
if ((o = rdbLoadObject(type,fp)) == NULL) goto eoferr;
|
||||||
/* Add the new object in the hash table */
|
/* Add the new object in the hash table */
|
||||||
@ -3934,7 +3929,7 @@ static void substrCommand(redisClient *c) {
|
|||||||
rangelen = (end-start)+1;
|
rangelen = (end-start)+1;
|
||||||
|
|
||||||
/* Return the result */
|
/* Return the result */
|
||||||
addReplySds(c,sdscatprintf(sdsempty(),"$%lu\r\n",rangelen));
|
addReplySds(c,sdscatprintf(sdsempty(),"$%zu\r\n",rangelen));
|
||||||
range = sdsnewlen((char*)o->ptr+start,rangelen);
|
range = sdsnewlen((char*)o->ptr+start,rangelen);
|
||||||
addReplySds(c,range);
|
addReplySds(c,range);
|
||||||
addReply(c,shared.crlf);
|
addReply(c,shared.crlf);
|
||||||
@ -7215,6 +7210,7 @@ static int syncWithMaster(void) {
|
|||||||
"temp-%d.%ld.rdb",(int)time(NULL),(long int)getpid());
|
"temp-%d.%ld.rdb",(int)time(NULL),(long int)getpid());
|
||||||
dfd = open(tmpfile,O_CREAT|O_WRONLY|O_EXCL,0644);
|
dfd = open(tmpfile,O_CREAT|O_WRONLY|O_EXCL,0644);
|
||||||
if (dfd != -1) break;
|
if (dfd != -1) break;
|
||||||
|
sleep(1);
|
||||||
}
|
}
|
||||||
if (dfd == -1) {
|
if (dfd == -1) {
|
||||||
close(fd);
|
close(fd);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user