summaryrefslogtreecommitdiff
path: root/src/evict.c
diff options
context:
space:
mode:
authorMoti Cohen <moti.cohen@redis.com>2022-10-27 11:57:04 +0300
committerGitHub <noreply@github.com>2022-10-27 11:57:04 +0300
commitc0d7226274feb6a519a17a169421295da827a30c (patch)
tree5979108e5896190fd08146f61578e00d13b36a60 /src/evict.c
parent38028dab8d6d2721865aa17e6fbc31a64ee26761 (diff)
downloadredis-c0d7226274feb6a519a17a169421295da827a30c.tar.gz
Refactor and (internally) rebrand from pause-clients to pause-actions (#11098)
Renamed from "Pause Clients" to "Pause Actions" since the mechanism can pause several actions in redis, not just clients (e.g. eviction, expiration). Previously each pause purpose (which has a timeout that's tracked separately from others purposes), also implicitly dictated what it pauses (reads, writes, eviction, etc). Now it is explicit, and the actions that are paused (bit flags) are defined separately from the purpose. - Previously, when using feature pause-client it also implicitly means to make the server static: - Pause replica traffic - Pauses eviction processing - Pauses expire processing Making the server static is used also for failover and shutdown. This PR internally rebrand pause-client API to become pause-action API. It also Simplifies pauseClients structure by replacing pointers array with static array. The context of this PR is to add another trigger to pause-client which will activated in case of OOM as throttling mechanism ([see here](https://github.com/redis/redis/issues/10907)). In this case we want only to pause client, and eviction actions.
Diffstat (limited to 'src/evict.c')
-rw-r--r--src/evict.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/evict.c b/src/evict.c
index 45ec95f1f..637a8b6c7 100644
--- a/src/evict.c
+++ b/src/evict.c
@@ -487,10 +487,8 @@ static int isSafeToPerformEvictions(void) {
* and just be masters exact copies. */
if (server.masterhost && server.repl_slave_ignore_maxmemory) return 0;
- /* 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 (checkClientPauseTimeoutAndReturnIfPaused()) return 0;
+ /* If 'evict' action is paused, for whatever reason, then return false */
+ if (isPausedActionsWithUpdate(PAUSE_ACTION_EVICT)) return 0;
return 1;
}