disable key cache during load if necessary

Former-commit-id: 68dcf66909e2138da4902bdec98985f4fcd737cf
This commit is contained in:
John Sully 2021-10-04 07:35:36 +00:00
parent 9d78b8bb08
commit ac22f3c60f

View File

@ -2683,6 +2683,16 @@ public:
ProcessWhileBlocked();
resumeExecution();
}
if ((getMaxmemoryState(NULL,NULL,NULL,NULL) != C_OK)) {
for (int idb = 0; idb < cserver.dbnum; ++idb) {
redisDb *db = g_pserver->db[idb];
if (db->size() > 0 && db->keycacheIsEnabled()) {
serverLog(LL_WARNING, "Key cache %d exceeds maxmemory during load, freeing - performance may be affected increase maxmemory if possible", idb);
db->disableKeyCache();
}
}
}
}
}