MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / updateFlashMaxmemory

Function updateFlashMaxmemory

src/config.cpp:2600–2611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2598}
2599
2600static int updateFlashMaxmemory(long long val, long long prev, const char **err) {
2601 UNUSED(prev);
2602 UNUSED(err);
2603 if (val && g_pserver->m_pstorageFactory) {
2604 size_t used = g_pserver->m_pstorageFactory->totalDiskspaceUsed();
2605 if ((unsigned long long)val < used) {
2606 serverLog(LL_WARNING,"WARNING: the new maxstorage value set via CONFIG SET (%llu) is smaller than the current storage usage (%zu). This will result in key eviction and/or the inability to accept new write commands depending on the maxmemory-policy.", g_pserver->maxstorage, used);
2607 }
2608 performEvictions(false /*fPreSnapshot*/);
2609 }
2610 return 1;
2611}
2612
2613static int updateGoodSlaves(long long val, long long prev, const char **err) {
2614 UNUSED(val);

Callers

nothing calls this directly

Calls 3

serverLogFunction · 0.85
performEvictionsFunction · 0.85
totalDiskspaceUsedMethod · 0.45

Tested by

no test coverage detected