mirror of
https://github.com/redis/redis.git
synced 2026-04-21 03:01:35 -04:00
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:
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 */
|
||||
|
||||
Reference in New Issue
Block a user