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
e6d423362a
commit
b6916ca91c
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].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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user