From 03af999cb0befed9d2556c2df1eb0511de2d96d2 Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 22 Mar 2011 19:35:42 +0100 Subject: [PATCH 1/8] command table altered for the new API to get position of keys arguments in commands --- src/redis.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/redis.c b/src/redis.c index 866ac360..51e58f58 100644 --- a/src/redis.c +++ b/src/redis.c @@ -70,12 +70,12 @@ struct redisServer server; /* server global state */ struct redisCommand *commandTable; struct redisCommand redisCommandTable[] = { {"get",getCommand,2,0,NULL,1,1,1,0,0}, - {"set",setCommand,3,REDIS_CMD_DENYOOM,NULL,0,0,0,0,0}, - {"setnx",setnxCommand,3,REDIS_CMD_DENYOOM,NULL,0,0,0,0,0}, - {"setex",setexCommand,4,REDIS_CMD_DENYOOM,NULL,0,0,0,0,0}, + {"set",setCommand,3,REDIS_CMD_DENYOOM,noPreloadGetKeys,1,1,1,0,0}, + {"setnx",setnxCommand,3,REDIS_CMD_DENYOOM,noPreloadGetKeys,1,1,1,0,0}, + {"setex",setexCommand,4,REDIS_CMD_DENYOOM,noPreloadGetKeys,2,2,1,0,0}, {"append",appendCommand,3,REDIS_CMD_DENYOOM,NULL,1,1,1,0,0}, {"strlen",strlenCommand,2,0,NULL,1,1,1,0,0}, - {"del",delCommand,-2,0,NULL,0,0,0,0,0}, + {"del",delCommand,-2,0,noPreloadGetKeys,1,-1,1,0,0}, {"exists",existsCommand,2,0,NULL,1,1,1,0,0}, {"setbit",setbitCommand,4,REDIS_CMD_DENYOOM,NULL,1,1,1,0,0}, {"getbit",getbitCommand,3,0,NULL,1,1,1,0,0}, @@ -94,7 +94,7 @@ struct redisCommand redisCommandTable[] = { {"lpop",lpopCommand,2,0,NULL,1,1,1,0,0}, {"brpop",brpopCommand,-3,0,NULL,1,1,1,0,0}, {"brpoplpush",brpoplpushCommand,4,REDIS_CMD_DENYOOM,NULL,1,2,1,0,0}, - {"blpop",blpopCommand,-3,0,NULL,1,1,1,0,0}, + {"blpop",blpopCommand,-3,0,NULL,1,-2,1,0,0}, {"llen",llenCommand,2,0,NULL,1,1,1,0,0}, {"lindex",lindexCommand,3,0,NULL,1,1,1,0,0}, {"lset",lsetCommand,4,REDIS_CMD_DENYOOM,NULL,1,1,1,0,0}, @@ -121,8 +121,8 @@ struct redisCommand redisCommandTable[] = { {"zrem",zremCommand,3,0,NULL,1,1,1,0,0}, {"zremrangebyscore",zremrangebyscoreCommand,4,0,NULL,1,1,1,0,0}, {"zremrangebyrank",zremrangebyrankCommand,4,0,NULL,1,1,1,0,0}, - {"zunionstore",zunionstoreCommand,-4,REDIS_CMD_DENYOOM,zunionInterBlockClientOnSwappedKeys,0,0,0,0,0}, - {"zinterstore",zinterstoreCommand,-4,REDIS_CMD_DENYOOM,zunionInterBlockClientOnSwappedKeys,0,0,0,0,0}, + {"zunionstore",zunionstoreCommand,-4,REDIS_CMD_DENYOOM,zunionInterGetKeys,0,0,0,0,0}, + {"zinterstore",zinterstoreCommand,-4,REDIS_CMD_DENYOOM,zunionInterGetKeys,0,0,0,0,0}, {"zrange",zrangeCommand,-4,0,NULL,1,1,1,0,0}, {"zrangebyscore",zrangebyscoreCommand,-4,0,NULL,1,1,1,0,0}, {"zrevrangebyscore",zrevrangebyscoreCommand,-4,0,NULL,1,1,1,0,0}, @@ -152,10 +152,10 @@ struct redisCommand redisCommandTable[] = { {"randomkey",randomkeyCommand,1,0,NULL,0,0,0,0,0}, {"select",selectCommand,2,0,NULL,0,0,0,0,0}, {"move",moveCommand,3,0,NULL,1,1,1,0,0}, - {"rename",renameCommand,3,0,NULL,1,1,1,0,0}, - {"renamenx",renamenxCommand,3,0,NULL,1,1,1,0,0}, - {"expire",expireCommand,3,0,NULL,0,0,0,0,0}, - {"expireat",expireatCommand,3,0,NULL,0,0,0,0,0}, + {"rename",renameCommand,3,0,renameGetKeys,1,2,1,0,0}, + {"renamenx",renamenxCommand,3,0,renameGetKeys,1,2,1,0,0}, + {"expire",expireCommand,3,0,NULL,1,1,1,0,0}, + {"expireat",expireatCommand,3,0,NULL,1,1,1,0,0}, {"keys",keysCommand,2,0,NULL,0,0,0,0,0}, {"dbsize",dbsizeCommand,1,0,NULL,0,0,0,0,0}, {"auth",authCommand,2,0,NULL,0,0,0,0,0}, @@ -168,7 +168,7 @@ struct redisCommand redisCommandTable[] = { {"lastsave",lastsaveCommand,1,0,NULL,0,0,0,0,0}, {"type",typeCommand,2,0,NULL,1,1,1,0,0}, {"multi",multiCommand,1,0,NULL,0,0,0,0,0}, - {"exec",execCommand,1,REDIS_CMD_DENYOOM,execBlockClientOnSwappedKeys,0,0,0,0,0}, + {"exec",execCommand,1,REDIS_CMD_DENYOOM,execGetKeys,0,0,0,0,0}, {"discard",discardCommand,1,0,NULL,0,0,0,0,0}, {"sync",syncCommand,1,0,NULL,0,0,0,0,0}, {"flushdb",flushdbCommand,1,0,NULL,0,0,0,0,0}, @@ -186,7 +186,7 @@ struct redisCommand redisCommandTable[] = { {"psubscribe",psubscribeCommand,-2,0,NULL,0,0,0,0,0}, {"punsubscribe",punsubscribeCommand,-1,0,NULL,0,0,0,0,0}, {"publish",publishCommand,3,REDIS_CMD_FORCE_REPLICATION,NULL,0,0,0,0,0}, - {"watch",watchCommand,-2,0,NULL,0,0,0,0,0}, + {"watch",watchCommand,-2,0,noPreloadGetKeys,1,-1,1,0,0}, {"unwatch",unwatchCommand,1,0,NULL,0,0,0,0,0} }; From 9791f0f8ceb18e2e3c297a8c479307b7af0f9830 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 23 Mar 2011 18:09:17 +0100 Subject: [PATCH 2/8] new preloading implemented, still EXEC not handled correctly, everything to test --- src/db.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/dscache.c | 14 ++++++---- src/redis.c | 2 +- src/redis.h | 26 ++++++++++++------- 4 files changed, 98 insertions(+), 16 deletions(-) diff --git a/src/db.c b/src/db.c index 9daa5ddb..9bc299ca 100644 --- a/src/db.c +++ b/src/db.c @@ -616,3 +616,75 @@ void persistCommand(redisClient *c) { } } } + +/* ----------------------------------------------------------------------------- + * API to get key arguments from commands + * ---------------------------------------------------------------------------*/ + +int *getKeysUsingCommandTable(struct redisCommand *cmd,robj **argv, int argc, int *numkeys) { + int j, i = 0, last, *keys; + REDIS_NOTUSED(argv); + + if (cmd->firstkey == 0) { + *numkeys = 0; + return NULL; + } + last = cmd->lastkey; + if (last < 0) last = argc+last; + keys = zmalloc(sizeof(int)*((last - cmd->firstkey)+1)); + for (j = cmd->firstkey; j <= last; j += cmd->keystep) { + redisAssert(j < argc); + keys[i] = j; + } + return keys; +} + +int *getKeysFromCommand(struct redisCommand *cmd,robj **argv, int argc, int *numkeys, int flags) { + if (cmd->getkeys_proc) { + return cmd->getkeys_proc(cmd,argv,argc,numkeys,flags); + } else { + return getKeysUsingCommandTable(cmd,argv,argc,numkeys); + } +} + +void getKeysFreeResult(int *result) { + zfree(result); +} + +int *noPreloadGetKeys(struct redisCommand *cmd,robj **argv, int argc, int *numkeys, int flags) { + if (flags & REDIS_GETKEYS_PRELOAD) { + *numkeys = 0; + return NULL; + } else { + return getKeysUsingCommandTable(cmd,argv,argc,numkeys); + } +} + +int *renameGetKeys(struct redisCommand *cmd,robj **argv, int argc, int *numkeys, int flags) { + if (flags & REDIS_GETKEYS_PRELOAD) { + int *keys = zmalloc(sizeof(int)); + *numkeys = 1; + keys[0] = 1; + return NULL; + } else { + return getKeysUsingCommandTable(cmd,argv,argc,numkeys); + } +} + +int *zunionInterGetKeys(struct redisCommand *cmd,robj **argv, int argc, int *numkeys, int flags) { + int i, num, *keys; + REDIS_NOTUSED(cmd); + REDIS_NOTUSED(flags); + + num = atoi(argv[2]->ptr); + /* Sanity check. Don't return any key if the command is going to + * reply with syntax error. */ + if (num > (argc-3)) { + *numkeys = 0; + return NULL; + } + keys = zmalloc(num); + for (i = 0; i < num; i++) keys[i] = 3+i; + *numkeys = num; + return keys; +} diff --git a/src/dscache.c b/src/dscache.c index cbe9bb01..5813052e 100644 --- a/src/dscache.c +++ b/src/dscache.c @@ -903,6 +903,7 @@ int waitForSwappedKey(redisClient *c, robj *key) { return 1; } +#if 0 /* Preload keys for any command with first, last and step values for * the command keys prototype, as defined in the command table. */ void waitForMultipleSwappedKeys(redisClient *c, struct redisCommand *cmd, int argc, robj **argv) { @@ -955,6 +956,7 @@ void execBlockClientOnSwappedKeys(redisClient *c, struct redisCommand *cmd, int } } } +#endif /* Is this client attempting to run a command against swapped keys? * If so, block it ASAP, load the keys in background, then resume it. @@ -967,11 +969,13 @@ void execBlockClientOnSwappedKeys(redisClient *c, struct redisCommand *cmd, int * Return 1 if the client is marked as blocked, 0 if the client can * continue as the keys it is going to access appear to be in memory. */ int blockClientOnSwappedKeys(redisClient *c, struct redisCommand *cmd) { - if (cmd->vm_preload_proc != NULL) { - cmd->vm_preload_proc(c,cmd,c->argc,c->argv); - } else { - waitForMultipleSwappedKeys(c,cmd,c->argc,c->argv); - } + int *keyindex, numkeys, j; + + keyindex = getKeysFromCommand(cmd,c->argv,c->argc,&numkeys,REDIS_GETKEYS_PRELOAD); + for (j = 0; j < numkeys; j++) waitForSwappedKey(c,c->argv[keyindex[j]]); + getKeysFreeResult(keyindex); + +#warning "Handle EXEC here" /* If the client was blocked for at least one key, mark it as blocked. */ if (listLength(c->io_keys)) { diff --git a/src/redis.c b/src/redis.c index 51e58f58..19fd912c 100644 --- a/src/redis.c +++ b/src/redis.c @@ -168,7 +168,7 @@ struct redisCommand redisCommandTable[] = { {"lastsave",lastsaveCommand,1,0,NULL,0,0,0,0,0}, {"type",typeCommand,2,0,NULL,1,1,1,0,0}, {"multi",multiCommand,1,0,NULL,0,0,0,0,0}, - {"exec",execCommand,1,REDIS_CMD_DENYOOM,execGetKeys,0,0,0,0,0}, + {"exec",execCommand,1,REDIS_CMD_DENYOOM,NULL,0,0,0,0,0}, {"discard",discardCommand,1,0,NULL,0,0,0,0,0}, {"sync",syncCommand,1,0,NULL,0,0,0,0,0}, {"flushdb",flushdbCommand,1,0,NULL,0,0,0,0,0}, diff --git a/src/redis.h b/src/redis.h index cdddb601..b5188330 100644 --- a/src/redis.h +++ b/src/redis.h @@ -507,20 +507,19 @@ typedef struct pubsubPattern { } pubsubPattern; typedef void redisCommandProc(redisClient *c); -typedef void redisVmPreloadProc(redisClient *c, struct redisCommand *cmd, int argc, robj **argv); +typedef int *redisGetKeysProc(struct redisCommand *cmd, robj **argv, int argc, int *numkeys, int flags); struct redisCommand { char *name; redisCommandProc *proc; int arity; int flags; - /* Use a function to determine which keys need to be loaded - * in the background prior to executing this command. Takes precedence - * over vm_firstkey and others, ignored when NULL */ - redisVmPreloadProc *vm_preload_proc; + /* Use a function to determine keys arguments in a command line. + * Used both for diskstore preloading and Redis Cluster. */ + redisGetKeysProc *getkeys_proc; /* What keys should be loaded in background when calling this command? */ - int vm_firstkey; /* The first argument that's a key (0 = no keys) */ - int vm_lastkey; /* THe last argument that's a key */ - int vm_keystep; /* The step between first and last key */ + int firstkey; /* The first argument that's a key (0 = no keys) */ + int lastkey; /* THe last argument that's a key */ + int keystep; /* The step between first and last key */ long long microseconds, calls; }; @@ -829,8 +828,6 @@ void freeIOJob(iojob *j); void queueIOJob(iojob *j); void waitEmptyIOJobsQueue(void); void processAllPendingIOJobs(void); -void zunionInterBlockClientOnSwappedKeys(redisClient *c, struct redisCommand *cmd, int argc, robj **argv); -void execBlockClientOnSwappedKeys(redisClient *c, struct redisCommand *cmd, int argc, robj **argv); int blockClientOnSwappedKeys(redisClient *c, struct redisCommand *cmd); int dontWaitForSwappedKey(redisClient *c, robj *key); void handleClientsBlockedOnSwappedKey(redisDb *db, robj *key); @@ -917,6 +914,15 @@ int selectDb(redisClient *c, int id); void signalModifiedKey(redisDb *db, robj *key); void signalFlushedDb(int dbid); +/* API to get key arguments from commands */ +#define REDIS_GETKEYS_ALL 0 +#define REDIS_GETKEYS_PRELOAD 1 +int *getKeysFromCommand(struct redisCommand *cmd, robj **argv, int argc, int *numkeys, int flags); +void getKeysFreeResult(int *result); +int *noPreloadGetKeys(struct redisCommand *cmd,robj **argv, int argc, int *numkeys, int flags); +int *renameGetKeys(struct redisCommand *cmd,robj **argv, int argc, int *numkeys, int flags); +int *zunionInterGetKeys(struct redisCommand *cmd,robj **argv, int argc, int *numkeys, int flags); + /* Git SHA1 */ char *redisGitSHA1(void); char *redisGitDirty(void); From a3cf9041218518f235a297b2f2d0d08ef9a5c4e5 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 23 Mar 2011 23:13:15 +0100 Subject: [PATCH 3/8] minor style change --- src/dscache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dscache.c b/src/dscache.c index 5813052e..faf87e84 100644 --- a/src/dscache.c +++ b/src/dscache.c @@ -971,7 +971,8 @@ void execBlockClientOnSwappedKeys(redisClient *c, struct redisCommand *cmd, int int blockClientOnSwappedKeys(redisClient *c, struct redisCommand *cmd) { int *keyindex, numkeys, j; - keyindex = getKeysFromCommand(cmd,c->argv,c->argc,&numkeys,REDIS_GETKEYS_PRELOAD); + keyindex = getKeysFromCommand(cmd,c->argv,c->argc,&numkeys, + REDIS_GETKEYS_PRELOAD); for (j = 0; j < numkeys; j++) waitForSwappedKey(c,c->argv[keyindex[j]]); getKeysFreeResult(keyindex); From 42b2621cdc4dfc47f90cf1085761ad89171a6a60 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 28 Mar 2011 17:29:26 +0200 Subject: [PATCH 4/8] implemented preload of EXEC using the new getKeys() system --- src/dscache.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/dscache.c b/src/dscache.c index faf87e84..45865264 100644 --- a/src/dscache.c +++ b/src/dscache.c @@ -969,14 +969,33 @@ void execBlockClientOnSwappedKeys(redisClient *c, struct redisCommand *cmd, int * Return 1 if the client is marked as blocked, 0 if the client can * continue as the keys it is going to access appear to be in memory. */ int blockClientOnSwappedKeys(redisClient *c, struct redisCommand *cmd) { - int *keyindex, numkeys, j; + int *keyindex, numkeys, j, i; - keyindex = getKeysFromCommand(cmd,c->argv,c->argc,&numkeys, - REDIS_GETKEYS_PRELOAD); - for (j = 0; j < numkeys; j++) waitForSwappedKey(c,c->argv[keyindex[j]]); - getKeysFreeResult(keyindex); + /* EXEC is a special case, we need to preload all the commands + * queued into the transaction */ + if (cmd->proc == execCommand) { + struct redisCommand *mcmd; + robj **margv; + int margc; -#warning "Handle EXEC here" + if (!(c->flags & REDIS_MULTI)) return 0; + for (i = 0; i < c->mstate.count; i++) { + mcmd = c->mstate.commands[i].cmd; + margc = c->mstate.commands[i].argc; + margv = c->mstate.commands[i].argv; + + keyindex = getKeysFromCommand(mcmd,margv,margc,&numkeys, + REDIS_GETKEYS_PRELOAD); + for (j = 0; j < numkeys; j++) + waitForSwappedKey(c,margv[keyindex[j]]); + getKeysFreeResult(keyindex); + } + } else { + keyindex = getKeysFromCommand(cmd,c->argv,c->argc,&numkeys, + REDIS_GETKEYS_PRELOAD); + for (j = 0; j < numkeys; j++) waitForSwappedKey(c,c->argv[keyindex[j]]); + getKeysFreeResult(keyindex); + } /* If the client was blocked for at least one key, mark it as blocked. */ if (listLength(c->io_keys)) { From b4b5144694a4134544221a5587b81a98aec608be Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 28 Mar 2011 17:54:42 +0200 Subject: [PATCH 5/8] Fixes to the new preloading / key discovery APIs --- src/db.c | 3 ++- src/dscache.c | 66 +++++++-------------------------------------------- 2 files changed, 11 insertions(+), 58 deletions(-) diff --git a/src/db.c b/src/db.c index 9bc299ca..5bab42af 100644 --- a/src/db.c +++ b/src/db.c @@ -634,8 +634,9 @@ int *getKeysUsingCommandTable(struct redisCommand *cmd,robj **argv, int argc, in keys = zmalloc(sizeof(int)*((last - cmd->firstkey)+1)); for (j = cmd->firstkey; j <= last; j += cmd->keystep) { redisAssert(j < argc); - keys[i] = j; + keys[i++] = j; } + *numkeys = i; return keys; } diff --git a/src/dscache.c b/src/dscache.c index 45865264..31498358 100644 --- a/src/dscache.c +++ b/src/dscache.c @@ -903,61 +903,6 @@ int waitForSwappedKey(redisClient *c, robj *key) { return 1; } -#if 0 -/* Preload keys for any command with first, last and step values for - * the command keys prototype, as defined in the command table. */ -void waitForMultipleSwappedKeys(redisClient *c, struct redisCommand *cmd, int argc, robj **argv) { - int j, last; - if (cmd->vm_firstkey == 0) return; - last = cmd->vm_lastkey; - if (last < 0) last = argc+last; - for (j = cmd->vm_firstkey; j <= last; j += cmd->vm_keystep) { - redisAssert(j < argc); - waitForSwappedKey(c,argv[j]); - } -} - -/* Preload keys needed for the ZUNIONSTORE and ZINTERSTORE commands. - * Note that the number of keys to preload is user-defined, so we need to - * apply a sanity check against argc. */ -void zunionInterBlockClientOnSwappedKeys(redisClient *c, struct redisCommand *cmd, int argc, robj **argv) { - int i, num; - REDIS_NOTUSED(cmd); - - num = atoi(argv[2]->ptr); - if (num > (argc-3)) return; - for (i = 0; i < num; i++) { - waitForSwappedKey(c,argv[3+i]); - } -} - -/* Preload keys needed to execute the entire MULTI/EXEC block. - * - * This function is called by blockClientOnSwappedKeys when EXEC is issued, - * and will block the client when any command requires a swapped out value. */ -void execBlockClientOnSwappedKeys(redisClient *c, struct redisCommand *cmd, int argc, robj **argv) { - int i, margc; - struct redisCommand *mcmd; - robj **margv; - REDIS_NOTUSED(cmd); - REDIS_NOTUSED(argc); - REDIS_NOTUSED(argv); - - if (!(c->flags & REDIS_MULTI)) return; - for (i = 0; i < c->mstate.count; i++) { - mcmd = c->mstate.commands[i].cmd; - margc = c->mstate.commands[i].argc; - margv = c->mstate.commands[i].argv; - - if (mcmd->vm_preload_proc != NULL) { - mcmd->vm_preload_proc(c,mcmd,margc,margv); - } else { - waitForMultipleSwappedKeys(c,mcmd,margc,margv); - } - } -} -#endif - /* Is this client attempting to run a command against swapped keys? * If so, block it ASAP, load the keys in background, then resume it. * @@ -986,14 +931,21 @@ int blockClientOnSwappedKeys(redisClient *c, struct redisCommand *cmd) { keyindex = getKeysFromCommand(mcmd,margv,margc,&numkeys, REDIS_GETKEYS_PRELOAD); - for (j = 0; j < numkeys; j++) + for (j = 0; j < numkeys; j++) { + redisLog(REDIS_WARNING,"Preloading %s", + (char*)margv[keyindex[j]]->ptr); waitForSwappedKey(c,margv[keyindex[j]]); + } getKeysFreeResult(keyindex); } } else { keyindex = getKeysFromCommand(cmd,c->argv,c->argc,&numkeys, REDIS_GETKEYS_PRELOAD); - for (j = 0; j < numkeys; j++) waitForSwappedKey(c,c->argv[keyindex[j]]); + for (j = 0; j < numkeys; j++) { + redisLog(REDIS_WARNING,"Preloading %s", + (char*)c->argv[keyindex[j]]->ptr); + waitForSwappedKey(c,c->argv[keyindex[j]]); + } getKeysFreeResult(keyindex); } From 6e1b9b58ec6ae895da686015d82d4f121f1bfb85 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 28 Mar 2011 18:21:06 +0200 Subject: [PATCH 6/8] bug fixed in zunionstore specific getKeys() implementation --- src/db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/db.c b/src/db.c index 5bab42af..7a9c9c4c 100644 --- a/src/db.c +++ b/src/db.c @@ -684,7 +684,7 @@ int *zunionInterGetKeys(struct redisCommand *cmd,robj **argv, int argc, int *num *numkeys = 0; return NULL; } - keys = zmalloc(num); + keys = zmalloc(sizeof(int)*num); for (i = 0; i < num; i++) keys[i] = 3+i; *numkeys = num; return keys; From 4b61ca460c5d043b9d199a4e4991bfac5dde66c5 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 28 Mar 2011 18:46:22 +0200 Subject: [PATCH 7/8] fixed a bug in RENAME getKeys() function --- src/db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/db.c b/src/db.c index 7a9c9c4c..fea2f12e 100644 --- a/src/db.c +++ b/src/db.c @@ -666,7 +666,7 @@ int *renameGetKeys(struct redisCommand *cmd,robj **argv, int argc, int *numkeys, int *keys = zmalloc(sizeof(int)); *numkeys = 1; keys[0] = 1; - return NULL; + return keys; } else { return getKeysUsingCommandTable(cmd,argv,argc,numkeys); } From a07bc9269234bba1f51211bff304ce9caa15a9fb Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 28 Mar 2011 19:03:57 +0200 Subject: [PATCH 8/8] Preloading messages log level changed from WARNING to DEBUG --- src/dscache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dscache.c b/src/dscache.c index 31498358..46300e63 100644 --- a/src/dscache.c +++ b/src/dscache.c @@ -932,7 +932,7 @@ int blockClientOnSwappedKeys(redisClient *c, struct redisCommand *cmd) { keyindex = getKeysFromCommand(mcmd,margv,margc,&numkeys, REDIS_GETKEYS_PRELOAD); for (j = 0; j < numkeys; j++) { - redisLog(REDIS_WARNING,"Preloading %s", + redisLog(REDIS_DEBUG,"Preloading %s", (char*)margv[keyindex[j]]->ptr); waitForSwappedKey(c,margv[keyindex[j]]); } @@ -942,7 +942,7 @@ int blockClientOnSwappedKeys(redisClient *c, struct redisCommand *cmd) { keyindex = getKeysFromCommand(cmd,c->argv,c->argc,&numkeys, REDIS_GETKEYS_PRELOAD); for (j = 0; j < numkeys; j++) { - redisLog(REDIS_WARNING,"Preloading %s", + redisLog(REDIS_DEBUG,"Preloading %s", (char*)c->argv[keyindex[j]]->ptr); waitForSwappedKey(c,c->argv[keyindex[j]]); }