mirror of https://mirror.osredm.com/root/redis.git
Reset average ttl when empty databases (#8106)
On FLUSHDB or full sync, reset old average TTL stat. This Stat is incrementally collected by the master over time when it searches for expired keys.
This commit is contained in:
parent
04056b767f
commit
c85bf2352d
3
src/db.c
3
src/db.c
|
@ -416,6 +416,9 @@ long long emptyDbGeneric(redisDb *dbarray, int dbnum, int flags, void(callback)(
|
||||||
dictEmpty(dbarray[j].dict,callback);
|
dictEmpty(dbarray[j].dict,callback);
|
||||||
dictEmpty(dbarray[j].expires,callback);
|
dictEmpty(dbarray[j].expires,callback);
|
||||||
}
|
}
|
||||||
|
/* Because we will start a new database, reset average ttl. */
|
||||||
|
dbarray[j].avg_ttl = 0;
|
||||||
|
dbarray[j].expires_cursor = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Post-flush actions */
|
/* Post-flush actions */
|
||||||
|
|
Loading…
Reference in New Issue