X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/8e2a225aa6cd1848a282d3d96742759cc24fc7e8..35e29472609cb3345809d48f0b4e7c75b6c1be6f:/src/redis.c diff --git a/src/redis.c b/src/redis.c index b1c34ebb..00eaab2a 100644 --- a/src/redis.c +++ b/src/redis.c @@ -49,6 +49,7 @@ #include #include #include +#include /* Our shared "common" objects */ @@ -1347,6 +1348,15 @@ void initServer() { } } + if (server.mdb_state == REDIS_MDB_ON) { + int retval = startKeyArchive(); + if (retval != 0) { + redisLog(REDIS_WARNING, "Can't open the key-archive environment: %s", + mdb_strerror(retval)); + exit(1); + } + } + /* 32 bit instances are limited to 4GB of address space, so if there is * no explicit limit in the user provided configuration we set a limit * at 3 GB using maxmemory with 'noeviction' policy'. This avoids @@ -2352,7 +2362,7 @@ int freeMemoryIfNeeded(void) { * AOF and Output buffer memory will be freed eventually so * we only care about memory used by the key space. */ delta = (long long) zmalloc_used_memory(); - dbDelete(db,keyobj); + dbDeleteSoft(db,keyobj); delta -= (long long) zmalloc_used_memory(); mem_freed += delta; server.stat_evictedkeys++;