X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/4d60dea85394c29d47e28709e02b974b448b0af2..f8956ed6d88fde242de8676dd615019b2c7e734e:/src/rdb.c diff --git a/src/rdb.c b/src/rdb.c index 14135480..60a70e01 100644 --- a/src/rdb.c +++ b/src/rdb.c @@ -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"); }