mirror of https://github.com/redis/redis.git
Fix typos in server.c
This commit is contained in:
parent
503a5a24fb
commit
0746f10117
26
src/server.c
26
src/server.c
|
@ -115,7 +115,7 @@ volatile unsigned long lru_clock; /* Server global current LRU time. */
|
||||||
* write: Write command (may modify the key space).
|
* write: Write command (may modify the key space).
|
||||||
*
|
*
|
||||||
* read-only: All the non special commands just reading from keys without
|
* read-only: All the non special commands just reading from keys without
|
||||||
* changing the content, or returning other informations like
|
* changing the content, or returning other information like
|
||||||
* the TIME command. Special commands such administrative commands
|
* the TIME command. Special commands such administrative commands
|
||||||
* or transaction related commands (multi, exec, discard, ...)
|
* or transaction related commands (multi, exec, discard, ...)
|
||||||
* are not flagged as read-only commands, since they affect the
|
* are not flagged as read-only commands, since they affect the
|
||||||
|
@ -1432,7 +1432,7 @@ void tryResizeHashTables(int dbid) {
|
||||||
/* Our hash table implementation performs rehashing incrementally while
|
/* Our hash table implementation performs rehashing incrementally while
|
||||||
* we write/read from the hash table. Still if the server is idle, the hash
|
* we write/read from the hash table. Still if the server is idle, the hash
|
||||||
* table will use two tables for a long time. So we try to use 1 millisecond
|
* table will use two tables for a long time. So we try to use 1 millisecond
|
||||||
* of CPU time at every call of this function to perform some rehahsing.
|
* of CPU time at every call of this function to perform some rehashing.
|
||||||
*
|
*
|
||||||
* The function returns 1 if some rehashing was performed, otherwise 0
|
* The function returns 1 if some rehashing was performed, otherwise 0
|
||||||
* is returned. */
|
* is returned. */
|
||||||
|
@ -1605,7 +1605,7 @@ int clientsCronTrackClientsMemUsage(client *c) {
|
||||||
mem += sdsAllocSize(c->querybuf);
|
mem += sdsAllocSize(c->querybuf);
|
||||||
mem += sizeof(client);
|
mem += sizeof(client);
|
||||||
/* Now that we have the memory used by the client, remove the old
|
/* Now that we have the memory used by the client, remove the old
|
||||||
* value from the old categoty, and add it back. */
|
* value from the old category, and add it back. */
|
||||||
server.stat_clients_type_memory[c->client_cron_last_memory_type] -=
|
server.stat_clients_type_memory[c->client_cron_last_memory_type] -=
|
||||||
c->client_cron_last_memory_usage;
|
c->client_cron_last_memory_usage;
|
||||||
server.stat_clients_type_memory[type] += mem;
|
server.stat_clients_type_memory[type] += mem;
|
||||||
|
@ -1897,18 +1897,18 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
|
||||||
* the frag ratio calculate may be off (ratio of two samples at different times) */
|
* the frag ratio calculate may be off (ratio of two samples at different times) */
|
||||||
server.cron_malloc_stats.process_rss = zmalloc_get_rss();
|
server.cron_malloc_stats.process_rss = zmalloc_get_rss();
|
||||||
server.cron_malloc_stats.zmalloc_used = zmalloc_used_memory();
|
server.cron_malloc_stats.zmalloc_used = zmalloc_used_memory();
|
||||||
/* Sampling the allcator info can be slow too.
|
/* Sampling the allocator info can be slow too.
|
||||||
* The fragmentation ratio it'll show is potentically more accurate
|
* The fragmentation ratio it'll show is potentially more accurate
|
||||||
* it excludes other RSS pages such as: shared libraries, LUA and other non-zmalloc
|
* it excludes other RSS pages such as: shared libraries, LUA and other non-zmalloc
|
||||||
* allocations, and allocator reserved pages that can be pursed (all not actual frag) */
|
* allocations, and allocator reserved pages that can be pursed (all not actual frag) */
|
||||||
zmalloc_get_allocator_info(&server.cron_malloc_stats.allocator_allocated,
|
zmalloc_get_allocator_info(&server.cron_malloc_stats.allocator_allocated,
|
||||||
&server.cron_malloc_stats.allocator_active,
|
&server.cron_malloc_stats.allocator_active,
|
||||||
&server.cron_malloc_stats.allocator_resident);
|
&server.cron_malloc_stats.allocator_resident);
|
||||||
/* in case the allocator isn't providing these stats, fake them so that
|
/* in case the allocator isn't providing these stats, fake them so that
|
||||||
* fragmention info still shows some (inaccurate metrics) */
|
* fragmentation info still shows some (inaccurate metrics) */
|
||||||
if (!server.cron_malloc_stats.allocator_resident) {
|
if (!server.cron_malloc_stats.allocator_resident) {
|
||||||
/* LUA memory isn't part of zmalloc_used, but it is part of the process RSS,
|
/* LUA memory isn't part of zmalloc_used, but it is part of the process RSS,
|
||||||
* so we must desuct it in order to be able to calculate correct
|
* so we must destruct it in order to be able to calculate correct
|
||||||
* "allocator fragmentation" ratio */
|
* "allocator fragmentation" ratio */
|
||||||
size_t lua_memory = lua_gc(server.lua,LUA_GCCOUNT,0)*1024LL;
|
size_t lua_memory = lua_gc(server.lua,LUA_GCCOUNT,0)*1024LL;
|
||||||
server.cron_malloc_stats.allocator_resident = server.cron_malloc_stats.process_rss - lua_memory;
|
server.cron_malloc_stats.allocator_resident = server.cron_malloc_stats.process_rss - lua_memory;
|
||||||
|
@ -2153,7 +2153,7 @@ void beforeSleep(struct aeEventLoop *eventLoop) {
|
||||||
if (moduleCount()) moduleReleaseGIL();
|
if (moduleCount()) moduleReleaseGIL();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function is called immadiately after the event loop multiplexing
|
/* This function is called immediately after the event loop multiplexing
|
||||||
* API returned, and the control is going to soon return to Redis by invoking
|
* API returned, and the control is going to soon return to Redis by invoking
|
||||||
* the different events callbacks. */
|
* the different events callbacks. */
|
||||||
void afterSleep(struct aeEventLoop *eventLoop) {
|
void afterSleep(struct aeEventLoop *eventLoop) {
|
||||||
|
@ -2369,7 +2369,7 @@ void initServerConfig(void) {
|
||||||
R_NegInf = -1.0/R_Zero;
|
R_NegInf = -1.0/R_Zero;
|
||||||
R_Nan = R_Zero/R_Zero;
|
R_Nan = R_Zero/R_Zero;
|
||||||
|
|
||||||
/* Command table -- we initiialize it here as it is part of the
|
/* Command table -- we initialize it here as it is part of the
|
||||||
* initial configuration, since command names may be changed via
|
* initial configuration, since command names may be changed via
|
||||||
* redis.conf using the rename-command directive. */
|
* redis.conf using the rename-command directive. */
|
||||||
server.commands = dictCreate(&commandTableDictType,NULL);
|
server.commands = dictCreate(&commandTableDictType,NULL);
|
||||||
|
@ -3099,12 +3099,12 @@ void propagate(struct redisCommand *cmd, int dbid, robj **argv, int argc,
|
||||||
*
|
*
|
||||||
* 'cmd' must be a pointer to the Redis command to replicate, dbid is the
|
* 'cmd' must be a pointer to the Redis command to replicate, dbid is the
|
||||||
* database ID the command should be propagated into.
|
* database ID the command should be propagated into.
|
||||||
* Arguments of the command to propagte are passed as an array of redis
|
* Arguments of the command to propagate are passed as an array of redis
|
||||||
* objects pointers of len 'argc', using the 'argv' vector.
|
* objects pointers of len 'argc', using the 'argv' vector.
|
||||||
*
|
*
|
||||||
* The function does not take a reference to the passed 'argv' vector,
|
* The function does not take a reference to the passed 'argv' vector,
|
||||||
* so it is up to the caller to release the passed argv (but it is usually
|
* so it is up to the caller to release the passed argv (but it is usually
|
||||||
* stack allocated). The function autoamtically increments ref count of
|
* stack allocated). The function automatically increments ref count of
|
||||||
* passed objects, so the caller does not need to. */
|
* passed objects, so the caller does not need to. */
|
||||||
void alsoPropagate(struct redisCommand *cmd, int dbid, robj **argv, int argc,
|
void alsoPropagate(struct redisCommand *cmd, int dbid, robj **argv, int argc,
|
||||||
int target)
|
int target)
|
||||||
|
@ -3472,7 +3472,7 @@ int processCommand(client *c) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Save out_of_memory result at script start, otherwise if we check OOM
|
/* Save out_of_memory result at script start, otherwise if we check OOM
|
||||||
* untill first write within script, memory used by lua stack and
|
* until first write within script, memory used by lua stack and
|
||||||
* arguments might interfere. */
|
* arguments might interfere. */
|
||||||
if (c->cmd->proc == evalCommand || c->cmd->proc == evalShaCommand) {
|
if (c->cmd->proc == evalCommand || c->cmd->proc == evalShaCommand) {
|
||||||
server.lua_oom = out_of_memory;
|
server.lua_oom = out_of_memory;
|
||||||
|
@ -3707,7 +3707,7 @@ int prepareForShutdown(int flags) {
|
||||||
|
|
||||||
/*================================== Commands =============================== */
|
/*================================== Commands =============================== */
|
||||||
|
|
||||||
/* Sometimes Redis cannot accept write commands because there is a perstence
|
/* Sometimes Redis cannot accept write commands because there is a persistence
|
||||||
* error with the RDB or AOF file, and Redis is configured in order to stop
|
* error with the RDB or AOF file, and Redis is configured in order to stop
|
||||||
* accepting writes in such situation. This function returns if such a
|
* accepting writes in such situation. This function returns if such a
|
||||||
* condition is active, and the type of the condition.
|
* condition is active, and the type of the condition.
|
||||||
|
|
Loading…
Reference in New Issue