Merge pull request #5689 from soloestoy/donot-evict-when-AOF-loading

evict: don't care about mem if loading
This commit is contained in:
Salvatore Sanfilippo 2018-12-12 11:29:10 +01:00 committed by GitHub
commit 7ae184bfea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -444,9 +444,15 @@ int getMaxmemoryState(size_t *total, size_t *logical, size_t *tofree, float *lev
* Otehrwise if we are over the memory limit, but not enough memory
* was freed to return back under the limit, the function returns C_ERR. */
int freeMemoryIfNeeded(void) {
/* By default slaves should ignore maxmemory and just be masters excat
* copies. */
if (server.masterhost && server.repl_slave_ignore_maxmemory) return C_OK;
/* By default replicas should ignore maxmemory
* and just be masters exact copies.
*
* And don't care about mem if loading. */
if (server.loading ||
(server.masterhost && server.repl_slave_ignore_maxmemory))
{
return C_OK;
}
size_t mem_reported, mem_tofree, mem_freed;
mstime_t latency, eviction_latency;