提交 f8956ed6 编写于 作者: A antirez

convert the zipmap into hash in rdb loading if the zipmap has too many elements

上级 4d60dea8
......@@ -838,7 +838,12 @@ robj *rdbLoadObject(int type, FILE *fp) {
o->ptr = zmalloc(sdslen(aux->ptr));
memcpy(o->ptr,aux->ptr,sdslen(aux->ptr));
decrRefCount(aux);
/* FIXME: conver the object if needed */
/* Convert to real hash if the number of items is too large.
* We don't check the max item size as this requires an O(N)
* scan usually. */
if (zipmapLen(o->ptr) > server.hash_max_zipmap_entries) {
convertToRealHash(o);
}
} else {
redisPanic("Unknown object type");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册