File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -380,6 +380,12 @@ int freeMemoryIfNeeded(void) {
380380 long long delta ;
381381 int slaves = listLength (server .slaves );
382382
383+ /* We cannot free memory while clients are paused as this will require
384+ * evictions which modify the dataset and will break the guarantee that
385+ * data will be static while clients are paused. */
386+ if (clientsArePaused ())
387+ goto cant_free ;
388+
383389 /* Check if we are over the memory usage limit. If we are not, no need
384390 * to subtract the slaves output buffers. We can just return ASAP. */
385391 mem_reported = zmalloc_used_memory ();
Original file line number Diff line number Diff line change @@ -105,6 +105,10 @@ void activeExpireCycle(int type) {
105105 int dbs_per_call = CRON_DBS_PER_CALL ;
106106 long long start = ustime (), timelimit ;
107107
108+ /* We cannot expire keys while clients are paused as the dataset is
109+ * supposed to be static. */
110+ if (clientsArePaused ()) return ;
111+
108112 if (type == ACTIVE_EXPIRE_CYCLE_FAST ) {
109113 /* Don't start a fast cycle if the previous cycle did not exited
110114 * for time limt. Also don't repeat a fast cycle for the same period
You can’t perform that action at this time.
0 commit comments