Prevent expirations and evictions while paused

Proposed fix to https://github.com/antirez/redis/issues/4027
This commit is contained in:
Zachary Marquez
2017-06-01 16:24:10 -05:00
parent e91b81c612
commit a3e53cf9bc
2 changed files with 10 additions and 0 deletions

View File

@ -105,6 +105,10 @@ void activeExpireCycle(int type) {
int dbs_per_call = CRON_DBS_PER_CALL;
long long start = ustime(), timelimit;
/* We cannot expire keys while clients are paused as the dataset is
* supposed to be static. */
if (clientsArePaused()) return;
if (type == ACTIVE_EXPIRE_CYCLE_FAST) {
/* Don't start a fast cycle if the previous cycle did not exited
* for time limt. Also don't repeat a fast cycle for the same period