X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/17b24ff30d5c84c489a9793e35b7497519a878b9..0d916763afa44c2c6d5e28a4fe0f167197b00fc7:/src/redis.c diff --git a/src/redis.c b/src/redis.c index b19ee891..7c97e6dc 100644 --- a/src/redis.c +++ b/src/redis.c @@ -192,7 +192,9 @@ struct redisCommand redisCommandTable[] = { {"restore",restoreCommand,4,0,NULL,0,0,0,0,0}, {"migrate",migrateCommand,6,0,NULL,0,0,0,0,0}, {"dump",dumpCommand,2,0,NULL,0,0,0,0,0}, - {"object",objectCommand,-2,0,NULL,0,0,0,0,0} + {"object",objectCommand,-2,0,NULL,0,0,0,0,0}, + {"client",clientCommand,-2,0,NULL,0,0,0,0,0}, + {"eval",evalCommand,-3,REDIS_CMD_DENYOOM,zunionInterGetKeys,0,0,0,0,0} }; /*============================ Utility functions ============================ */ @@ -980,6 +982,7 @@ void initServer() { if (server.ds_enabled) dsInit(); if (server.cluster_enabled) clusterInit(); + scriptingInit(); srand(time(NULL)^getpid()); } @@ -1095,13 +1098,15 @@ int processCommand(redisClient *c) { addReplyError(c,"The cluster is down. Check with CLUSTER INFO for more information"); return REDIS_OK; } else { - clusterNode *n = getNodeByQuery(c,cmd,c->argv,c->argc,&hashslot); + int ask; + clusterNode *n = getNodeByQuery(c,cmd,c->argv,c->argc,&hashslot,&ask); if (n == NULL) { - addReplyError(c,"Invalid cross-node request"); + addReplyError(c,"Multi keys request invalid in cluster"); return REDIS_OK; } else if (n != server.cluster.myself) { addReplySds(c,sdscatprintf(sdsempty(), - "-MOVED %d %s:%d\r\n",hashslot,n->ip,n->port)); + "-%s %d %s:%d\r\n", ask ? "ASK" : "MOVED", + hashslot,n->ip,n->port)); return REDIS_OK; } } @@ -1316,20 +1321,14 @@ sds genRedisInfoString(char *section) { "used_memory_peak:%zu\r\n" "used_memory_peak_human:%s\r\n" "mem_fragmentation_ratio:%.2f\r\n" - "peak_mem_fragmentation_ratio:%.2f\r\n" - "use_tcmalloc:%d\r\n", + "mem_allocator:%s\r\n", zmalloc_used_memory(), hmem, zmalloc_get_rss(), server.stat_peak_memory, peak_hmem, zmalloc_get_fragmentation_ratio(), - (float)zmalloc_get_rss()/server.stat_peak_memory, - #ifdef USE_TCMALLOC - 1 - #else - 0 - #endif + REDIS_MALLOC ); }