"deps/vscode:/vscode.git/clone" did not exist on "ba07e1f505cb529d0d0ae4cdfde10b65471839aa"
Commit 44d4b87f authored by antirez's avatar antirez
Browse files

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

parent cebac465
......@@ -893,7 +893,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% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment