Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
e084a394
Commit
e084a394
authored
Jun 01, 2017
by
Zachary Marquez
Committed by
antirez
Jun 27, 2017
Browse files
Prevent expirations and evictions while paused
Proposed fix to
https://github.com/antirez/redis/issues/4027
parent
61c78a52
Changes
1
Show whitespace changes
Inline
Side-by-side
src/server.c
View file @
e084a394
...
...
@@ -777,6 +777,11 @@ void activeExpireCycle(int type) {
int
dbs_per_call
=
CRON_DBS_PER_CALL
;
long
long
start
=
ustime
(),
timelimit
;
/* When clients are paused the dataset should be static not just from the
* POV of clients not being able to write, but also from the POV of
* expires and evictions of keys not being performed. */
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
...
...
@@ -3464,6 +3469,11 @@ int freeMemoryIfNeeded(void) {
int
slaves
=
listLength
(
server
.
slaves
);
mstime_t
latency
,
eviction_latency
;
/* When clients are paused the dataset should be static not just from the
* POV of clients not being able to write, but also from the POV of
* expires and evictions of keys not being performed. */
if
(
clientsArePaused
())
return
C_OK
;
/* Remove the size of slaves output buffers and AOF buffer from the
* count of used memory. */
mem_used
=
zmalloc_used_memory
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment