Redis rehash

1 · chengzi · Sept. 14, 2022, 8:33 a.m.
redis 渐进式rehash (incremental rehash) 参考: https://zhuanlan.zhihu.com/p/358366217 https://tech.meituan.com/2018/07/27/redis-rehash-practice-optimization.html redis 的核心数据结构 // dict.h typedef struct dict { dictType *type; void *privdata; dictht ht[2]; long rehashidx; /* rehashing not in progress if rehashidx == -1 */ int16_t pauserehash; /* If >0 rehashing is paused (<0 indicates coding error) */ } dict; typedef struct dictht { dictEntry **table; unsigned long size;...