3 fixes, 0 array access on boot, getAsync is useless on single theaded, and don't print COW info for BG thread work since it will be inaccurate
Former-commit-id: 09362ff44afed8525816437aead84f215eb59c36
This commit is contained in:
parent
88a148d86e
commit
6ead122691
@ -2596,7 +2596,7 @@ void initServerConfig(void) {
|
|||||||
|
|
||||||
// This will get dereferenced before the second stage init where we have the true db count
|
// This will get dereferenced before the second stage init where we have the true db count
|
||||||
// so make sure its zero and initialized
|
// so make sure its zero and initialized
|
||||||
g_pserver->db = (redisDb**)zcalloc(sizeof(redisDb*)*cserver.dbnum, MALLOC_LOCAL);
|
g_pserver->db = (redisDb**)zcalloc(sizeof(redisDb*)*std::max(cserver.dbnum, 1), MALLOC_LOCAL);
|
||||||
|
|
||||||
initConfigValues();
|
initConfigValues();
|
||||||
}
|
}
|
||||||
@ -3907,7 +3907,7 @@ int processCommand(client *c, int callFlags) {
|
|||||||
queueMultiCommand(c);
|
queueMultiCommand(c);
|
||||||
addReply(c,shared.queued);
|
addReply(c,shared.queued);
|
||||||
} else {
|
} else {
|
||||||
if (listLength(g_pserver->monitors) == 0 && c->cmd->proc == getCommand)
|
if (cserver.cthreads >= 2 && listLength(g_pserver->monitors) == 0 && c->cmd->proc == getCommand)
|
||||||
{
|
{
|
||||||
if (getCommandAsync(c))
|
if (getCommandAsync(c))
|
||||||
return C_OK;
|
return C_OK;
|
||||||
@ -5126,10 +5126,13 @@ int redisFork() {
|
|||||||
void sendChildCOWInfo(int ptype, const char *pname) {
|
void sendChildCOWInfo(int ptype, const char *pname) {
|
||||||
size_t private_dirty = zmalloc_get_private_dirty(-1);
|
size_t private_dirty = zmalloc_get_private_dirty(-1);
|
||||||
|
|
||||||
if (private_dirty) {
|
if (ptype != CHILD_INFO_TYPE_RDB)
|
||||||
serverLog(LL_NOTICE,
|
{
|
||||||
"%s: %zu MB of memory used by copy-on-write",
|
if (private_dirty) {
|
||||||
pname, private_dirty/(1024*1024));
|
serverLog(LL_NOTICE,
|
||||||
|
"%s: %zu MB of memory used by copy-on-write",
|
||||||
|
pname, private_dirty/(1024*1024));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_pserver->child_info_data.cow_size = private_dirty;
|
g_pserver->child_info_data.cow_size = private_dirty;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user