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

Function replicationScriptCacheFlush

src/replication.cpp:4564–4568  ·  view source on GitHub ↗

Empty the script cache. Should be called every time we are no longer sure * that every replica knows about all the scripts in our set, or when the * current AOF "context" is no longer aware of the script. In general we * should flush the cache: * * 1) Every time a new replica reconnects to this master and performs a * full SYNC (PSYNC does not require flushing). * 2) Every time an AOF re

Source from the content-addressed store, hash-verified

4562 * to reclaim otherwise unused memory.
4563 */
4564void replicationScriptCacheFlush(void) {
4565 dictEmpty(g_pserver->repl_scriptcache_dict,NULL);
4566 listRelease(g_pserver->repl_scriptcache_fifo);
4567 g_pserver->repl_scriptcache_fifo = listCreate();
4568}
4569
4570/* Add an entry into the script cache, if we reach max number of entries the
4571 * oldest is removed from the list. */

Callers 4

replicationCronFunction · 0.85
scriptCommandFunction · 0.85

Calls 3

dictEmptyFunction · 0.85
listReleaseFunction · 0.85
listCreateFunction · 0.85

Tested by

no test coverage detected