Merge error, server always flushes on eviction

Former-commit-id: 9b3b0c9a40ab5dcdac9620f0fbad84887cc9c832
This commit is contained in:
John Sully 2020-06-02 17:21:41 -04:00
parent 69a4ab0851
commit ad174ab352
2 changed files with 5 additions and 2 deletions

View File

@ -678,7 +678,7 @@ int freeMemoryIfNeeded(bool fPreSnapshot) {
result = C_OK;
cant_free:
if (!cserver.delete_on_evict)
if (!cserver.delete_on_evict && result != C_OK)
{
for (int idb = 0; idb < cserver.dbnum; ++idb)
{
@ -688,7 +688,7 @@ cant_free:
serverLog(LL_WARNING, "Failed to evict keys, falling back to flushing entire cache. Consider increasing maxmemory-samples.");
db->removeAllCachedValues();
if (((mem_reported - zmalloc_used_memory()) + mem_freed) >= mem_tofree)
return C_OK;
result = C_OK;
}
}
}

View File

@ -130,6 +130,9 @@ start_server [list tags {flash} overrides [list storage-provider {flash ./rocks.
} err
assert {$err == {OK}}
}
if {[log_file_matches [srv 0 stdout] "*Failed to evict*"]} {
fail "Server did not evict cleanly (detected full flush)"
}
r set last val
set dbsize [r dbsize]
assert {[s used_memory] < $limit+4096}