]> git.saurik.com Git - redis.git/commitdiff
DEL is now a vararg, IMPORTANT: memory leak fixed in loading DB code
authorantirez <antirez@gmail.com>
Sat, 9 May 2009 10:18:32 +0000 (12:18 +0200)
committerantirez <antirez@gmail.com>
Sat, 9 May 2009 10:18:32 +0000 (12:18 +0200)
Changelog
TODO
redis-cli.c
redis.c

index 8014317c2a9e73a456a2840595f85bfdf3505afd..5a642a03b5dbb0484e11da63711531638280844b 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,11 @@
+2009-05-09 doc changes
+2009-05-09 CPP client added thanks to Brian Hammond
+2009-05-06 Infinite number of arguments for MGET and all the other commands
+2009-05-04 Warns if /proc/sys/vm/overcommit_memory is set to 0 on Linux. Also make sure to don't resize the hash tables while the child process is saving in order to avoid copy-on-write of memory pages
+2009-04-30 zmalloc fix, return NULL or real malloc failure
+2009-04-30 more fixes for dict.c and the 150 million keys limit
+2009-04-30 dict.c modified to be able to handle more than 150,000,000 keys
+2009-04-29 fuzz stresser implemented in redis-test
 2009-04-29 fixed for HT resize check 32bits overflow
 2009-04-29 Check for fork() failure in background saving
 2009-04-29 fix for the LZF off-by-one bug added
diff --git a/TODO b/TODO
index 81d8c77a0999b6f99ad3d5e53e2e2f1c11064c85..ca2784be348d9ef5821084d0ee507c9a9154ab7d 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,18 +1,15 @@
 BEFORE REDIS 1.0.0-rc1
 
-- Contrib dir with RHL for Centos and other contributions like init scripts
-- Update the FAQ with max number of keys in a DB and the overcommit thing
+- SDIFF, SDIFFSTORE
 - Add number of keys for every DB in INFO
-- maxmemory support in config file.
-- Resize the expires hash tables if needed as well
-- TTL command that returns -1 if a key is not volatile otherwise the time to live of a volatile key.
-- Remove max number of args limit
+- maxmemory support
+- maxclients support
+- Resize the expires and Sets hash tables if needed as well? For Sets the right moment to check for this is probably in SREM
+- TTL command that returns -1 if a key is not volatile otherwise the time to live of a volatile key in seconds.
 - What happens if the saving child gets killed or segfaults instead of ending normally? Handle this.
 - Make sinterstore / unionstore / sdiffstore returning the cardinality of the resulting set.
-- maxclients directive
 - check 'server.dirty' everywere
 - Shutdown must kill other background savings before to start saving. Otherwise the DB can get replaced by the child that rename(2) after the parent for some reason. Child should trap the signal and remove the temp file name.
-- Document replication
 - Objects sharing configuration, add the directive "objectsharingpool <size>"
 - Make sure to convert all the fstat() calls to 64bit versions.
 - SINTERCOUNT, SUNIONCOUNT, SDIFFCOUNT
@@ -25,6 +22,7 @@ AFTER 1.0 stable release
 - Write the hash table size of every db in the dump, so that Redis can resize the hash table just one time when loading a big DB.
 - Elapsed time in logs for SAVE when saving is going to take more than 2 seconds
 - replication automated tests
+- LOCK / TRYLOCK / UNLOCK as described many times in the google group
 
 FUTURE HINTS
 
index e4ef342fdd78dd4c74d0a26a9f0bfc81b6860923..524157cd60911c4e565bb36b0a36a8980eee5f06 100644 (file)
@@ -60,7 +60,7 @@ static struct redisCommand cmdTable[] = {
     {"get",2,REDIS_CMD_INLINE},
     {"set",3,REDIS_CMD_BULK},
     {"setnx",3,REDIS_CMD_BULK},
-    {"del",2,REDIS_CMD_INLINE},
+    {"del",-2,REDIS_CMD_INLINE},
     {"exists",2,REDIS_CMD_INLINE},
     {"incr",2,REDIS_CMD_INLINE},
     {"decr",2,REDIS_CMD_INLINE},
diff --git a/redis.c b/redis.c
index 0d45040a091712b5f2ccba4c1b93aad80846a245..7f1cc3b6187541a1a49806833b732e45c77e5d47 100644 (file)
--- a/redis.c
+++ b/redis.c
@@ -367,7 +367,7 @@ static struct redisCommand cmdTable[] = {
     {"get",getCommand,2,REDIS_CMD_INLINE},
     {"set",setCommand,3,REDIS_CMD_BULK},
     {"setnx",setnxCommand,3,REDIS_CMD_BULK},
-    {"del",delCommand,2,REDIS_CMD_INLINE},
+    {"del",delCommand,-2,REDIS_CMD_INLINE},
     {"exists",existsCommand,2,REDIS_CMD_INLINE},
     {"incr",incrCommand,2,REDIS_CMD_INLINE},
     {"decr",decrCommand,2,REDIS_CMD_INLINE},
@@ -2012,6 +2012,7 @@ static robj *rdbLoadLzfStringObject(FILE*fp, int rdbver) {
     if ((val = sdsnewlen(NULL,len)) == NULL) goto err;
     if (fread(c,clen,1,fp) == 0) goto err;
     if (lzf_decompress(c,clen,val,len) == 0) goto err;
+    zfree(c);
     return createObject(REDIS_STRING,val);
 err:
     zfree(c);
@@ -2305,11 +2306,24 @@ static void decrbyCommand(redisClient *c) {
 /* ========================= Type agnostic commands ========================= */
 
 static void delCommand(redisClient *c) {
-    if (deleteKey(c->db,c->argv[1])) {
-        server.dirty++;
-        addReply(c,shared.cone);
-    } else {
+    int deleted = 0, j;
+
+    for (j = 1; j < c->argc; j++) {
+        if (deleteKey(c->db,c->argv[j])) {
+            server.dirty++;
+            deleted++;
+        }
+    }
+    switch(deleted) {
+    case 0:
         addReply(c,shared.czero);
+        break;
+    case 1:
+        addReply(c,shared.cone);
+        break;
+    default:
+        addReplySds(c,sdscatprintf(sdsempty(),":%d\r\n",deleted));
+        break;
     }
 }