s=sdscatprintf(s," * High allocator RSS overhead: This instance has an RSS memory overhead is greater than 1.1 (this means that the Resident Set Size of the allocator is much larger than the sum what the allocator actually holds). This problem is usually due to a large peak memory (check if there is a peak memory entry above in the report), you can try the MEMORY PURGE command to reclaim it.\n\n");
}
if(high_proc_rss){
s=sdscatprintf(s," * High process RSS overhead: This instance has non-allocator RSS memory overhead is greater than 1.1 (this means that the Resident Set Size of the Redis process is much larger than the RSS the allocator holds). This problem may be due to LUA scripts or Modules.\n\n");
s=sdscatprintf(s," * High process RSS overhead: This instance has non-allocator RSS memory overhead is greater than 1.1 (this means that the Resident Set Size of the Redis process is much larger than the RSS the allocator holds). This problem may be due to Lua scripts or Modules.\n\n");
}
if(big_slave_buf){
s=sdscat(s," * Big slave buffers: The slave output buffers in this instance are greater than 10MB for each slave (on average). This likely means that there is some slave instance that is struggling receiving data, either because it is too slow or because of networking issues. As a result, data piles on the master output buffers. Please try to identify what slave is not receiving data correctly and why. You can use the INFO output in order to check the slaves delays and the CLIENT LIST command to check the output buffers of each slave.\n\n");
s=sdscat(s," * Big replica buffers: The replica output buffers in this instance are greater than 10MB for each replica (on average). This likely means that there is some replica instance that is struggling receiving data, either because it is too slow or because of networking issues. As a result, data piles on the master output buffers. Please try to identify what replica is not receiving data correctly and why. You can use the INFO output in order to check the replicas delays and the CLIENT LIST command to check the output buffers of each replica.\n\n");
}
if(big_client_buf){
s=sdscat(s," * Big client buffers: The clients output buffers in this instance are greater than 200K per client (on average). This may result from different causes, like Pub/Sub clients subscribed to channels bot not receiving data fast enough, so that data piles on the Redis instance output buffer, or clients sending commands with large replies or very large sequences of commands in the same pipeline. Please use the CLIENT LIST command in order to investigate the issue if it causes problems in your instance, or to understand better why certain clients are using a big amount of memory.\n\n");
}
if(many_scripts){
s=sdscat(s," * Many scripts: There seem to be many cached scripts in this instance (more than 1000). This may be because scripts are generated and `EVAL`ed, instead of being parameterized (with KEYS and ARGV), `SCRIPT LOAD`ed and `EVALSHA`ed. Unless `SCRIPT FLUSH` is called periodically, the scripts' caches may end up consuming most of your memory.\n\n");
}
s=sdscat(s,"I'm here to keep you safe, Sam. I want to help you.\n");
addReplyError(c,"An LFU maxmemory policy is selected, idle time not tracked. Please note that when switching between policies at runtime LRU and LFU data will take some time to adjust.");
addReplyError(c,"An LFU maxmemory policy is not selected, access frequency not tracked. Please note that when switching between policies at runtime LRU and LFU data will take some time to adjust.");
serverLog(LL_NOTICE,"Before turning into a slave, using my master parameters to synthesize a cached master: I may be able to synchronize with the new master with just a partial transfer.");
serverLog(LL_NOTICE,"Before turning into a replica, using my master parameters to synthesize a cached master: I may be able to synchronize with the new master with just a partial transfer.");
}
/* Free a cached master, called when there are no longer the conditions for
addReplyError(c,"WAIT cannot be used with slave instances. Please also note that since Redis 4.0 if a slave is configured to be writable (which is not the default) writes to slaves are just local and are not propagated.");
addReplyError(c,"WAIT cannot be used with replica instances. Please also note that since Redis 4.0 if a replica is configured to be writable (which is not the default) writes to replicas are just local and are not propagated.");
"Write commands not allowed after non deterministic commands. Call redis.replicate_commands() at the start of your script in order to switch to single commands replication mode.");
...
...
@@ -493,11 +526,16 @@ int luaRedisGenericCommand(lua_State *lua, int raise_error) {
{
luaPushError(lua,shared.roslaveerr->ptr);
gotocleanup;
}elseif(server.stop_writes_on_bgsave_err&&
server.saveparamslen>0&&
server.lastbgsave_status==C_ERR)
{
}elseif(deny_write_type!=DISK_ERROR_TYPE_NONE){
if(deny_write_type==DISK_ERROR_TYPE_RDB){
luaPushError(lua,shared.bgsaveerr->ptr);
}else{
sdsaof_write_err=sdscatfmt(sdsempty(),
"-MISCONF Errors writing to the AOF file: %s\r\n",
strerror(server.aof_last_write_errno));
luaPushError(lua,aof_write_err);
sdsfree(aof_write_err);
}
gotocleanup;
}
}
...
...
@@ -506,10 +544,13 @@ int luaRedisGenericCommand(lua_State *lua, int raise_error) {
* could enlarge the memory usage are not allowed, but only if this is the
* first write in the context of this script, otherwise we can't stop
* in the middle. */
if(server.maxmemory&&server.lua_write_dirty==0&&
if(server.maxmemory&&/* Maxmemory is actually enabled. */
!server.loading&&/* Don't care about mem if loading. */
!server.masterhost&&/* Slave must execute the script. */
server.lua_write_dirty==0&&/* Script had no side effects so far. */
(cmd->flags&CMD_DENYOOM))
{
if(freeMemoryIfNeeded()==C_ERR){
if(getMaxmemoryState(NULL,NULL,NULL,NULL)!=C_OK){
luaPushError(lua,shared.oomerr->ptr);
gotocleanup;
}
...
...
@@ -628,6 +669,8 @@ cleanup:
argv_size=0;
}
c->user=NULL;
if(raise_error){
/* If we are here we should have an error in the stack, in the
* form of a table with an "err" field. Extract the string to
...
...
@@ -768,7 +811,7 @@ int luaRedisSetReplCommand(lua_State *lua) {
flags=lua_tonumber(lua,-1);
if((flags&~(PROPAGATE_AOF|PROPAGATE_REPL))!=0){
lua_pushstring(lua,"Invalid replication flags. Use REPL_AOF, REPL_SLAVE, REPL_ALL or REPL_NONE.");
lua_pushstring(lua,"Invalid replication flags. Use REPL_AOF, REPL_REPLICA, REPL_ALL or REPL_NONE.");
serverLog(LL_WARNING,"Lua slow script detected: still in execution after %lld milliseconds. You can try killing the script using the SCRIPT KILL command.",elapsed);
addReplySds(c,sdsnew("-NOTBUSY No scripts in execution right now.\r\n"));
}elseif(server.lua_caller->flags&CLIENT_MASTER){
addReplySds(c,sdsnew("-UNKILLABLE The busy script was sent by a master instance in the context of replication and cannot be killed.\r\n"));
}elseif(server.lua_write_dirty){
addReplySds(c,sdsnew("-UNKILLABLE Sorry the script already executed write commands against the dataset. You can either wait the script termination or kill the server in a hard way using the SHUTDOWN NOSAVE command.\r\n"));
}else{
...
...
@@ -1716,7 +1780,7 @@ int ldbRemoveChild(pid_t pid) {
return0;
}
/* Return the number of children we still did not received termination
/* Return the number of children we still did not receive termination
* acknowledge via wait() in the parent process. */
"-MASTERDOWN Link with MASTER is down and slave-serve-stale-data is set to 'no'.\r\n"));
"-MASTERDOWN Link with MASTER is down and replica-serve-stale-data is set to 'no'.\r\n"));
shared.bgsaveerr=createObject(OBJ_STRING,sdsnew(
"-MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.\r\n"));
shared.roslaveerr=createObject(OBJ_STRING,sdsnew(
"-READONLY You can't write against a read only slave.\r\n"));
"-READONLY You can't write against a read only replica.\r\n"));