From: antirez Date: Fri, 11 Jun 2010 18:27:56 +0000 (+0200) Subject: Merge branch 'lists' of git://github.com/pietern/redis X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/ac9b8cfe577d1a27dd0f377e3b9578a7505cf00f?hp=7d288d654793e867020b73d101c17d25bfbc256c Merge branch 'lists' of git://github.com/pietern/redis --- diff --git a/TODO b/TODO index b7d139e9..7b5febcb 100644 --- a/TODO +++ b/TODO @@ -5,12 +5,14 @@ VERSION 2.2 TODO (Optimizations and latency) ============================================ * Support for syslog(3). -* Lower the CPU usage. -* Lower the RAM usage everywhere possible. -* Specially encoded Sets (like Hashes). * Implement an UDP interface for low-latency operations. -* What about a special coding that is about storing the "rdb" serialized format instead of the actual value? This can be used when we have LRU in order to super-compress data into memory, for data not accessed frequetly. It's a VM-alike strategy but fully in memory, may reduce the space to hold some dataset in an impressive way. Trivial to implement. -* Another idea: LRU does not need to be super precise right? Maybe it's a good idea to just put into the skiplist implementing the LRU just the pointer to the key without evne incr/decr business, nor the need to remove the pointer when the key is deleted. There is to think more about that. +* Use the same pointer of db->dict in db->expire hash table for keys. + 1) Set the keyptr hash table type key destructor to NULL. + 2) Don't copy the key in setExpire(), but instead lookup the same key + in the dict hash table, and use it. + 3) Make sure (and add comments about this) that when a key is deleted or + an expire is touched, the order is: delete the expire, delete the key. + 4) Make sure the SETEX command works well in all the cases. Add tests. VERSION 2.x TODO ================ diff --git a/redis.c b/redis.c index 2b0e5d37..8ac16295 100644 --- a/redis.c +++ b/redis.c @@ -4247,8 +4247,8 @@ static robj *rdbLoadObject(int type, FILE *fp) { while(hashlen--) { robj *key, *val; - if ((key = rdbLoadStringObject(fp)) == NULL) return NULL; - if ((val = rdbLoadStringObject(fp)) == NULL) return NULL; + if ((key = rdbLoadEncodedStringObject(fp)) == NULL) return NULL; + if ((val = rdbLoadEncodedStringObject(fp)) == NULL) return NULL; /* If we are using a zipmap and there are too big values * the object is converted to real hash table encoding. */ if (o->encoding != REDIS_ENCODING_HT && @@ -8024,6 +8024,7 @@ static void discardCommand(redisClient *c) { freeClientMultiState(c); initClientMultiState(c); c->flags &= (~REDIS_MULTI); + unwatchAllKeys(c); addReply(c,shared.ok); }