Replication of scripts as EVALSHA: sha1 caching implemented.

This code is only responsible to take an LRU-evicted fixed length cache
of SHA1 that we are sure all the slaves received.

In this commit only the implementation is provided, but the Redis core
does not use it to actually send EVALSHA to slaves when possible.
This commit is contained in:
antirez
2013-06-24 10:26:04 +02:00
parent 8328d993e1
commit 9d894b1b8c
3 changed files with 96 additions and 1 deletions

View File

@ -561,6 +561,18 @@ dictType keylistDictType = {
dictListDestructor /* val destructor */
};
/* Replication cached script dict (server.repl_scriptcache_dict).
* Keys are sds SHA1 strings, while values are not used at all in the current
* implementation. */
dictType replScriptCacheDictType = {
dictSdsHash, /* hash function */
NULL, /* key dup */
NULL, /* val dup */
dictSdsKeyCompare, /* key compare */
dictSdsDestructor, /* key destructor */
NULL /* val destructor */
};
int htNeedsResize(dict *dict) {
long long size, used;