summaryrefslogtreecommitdiff
path: root/src/server.c
diff options
context:
space:
mode:
authorsundb <sundbcn@gmail.com>2022-12-29 00:15:50 +0800
committerGitHub <noreply@github.com>2022-12-28 18:15:50 +0200
commitaf0a4fe20771603f0eab75a1f60748d124cf33c3 (patch)
tree49c2c0a2e90ce415c5dbe45c199fb189f12868e7 /src/server.c
parent7379d2219620d809943f32a5d26137a077bbae37 (diff)
downloadredis-af0a4fe20771603f0eab75a1f60748d124cf33c3.tar.gz
Remove unnecessary updateClientMemUsageAndBucket() when feeding monitors (#11657)
This call is introduced in #8687, but became irrelevant in #11348, and is currently a no-op. The fact is that #11348 an unintended side effect, which is that even if the client eviction config is enabled, there are certain types of clients for which memory consumption is not accurately tracked, and so unlike normal clients, their memory isn't reported correctly in INFO.
Diffstat (limited to 'src/server.c')
-rw-r--r--src/server.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/server.c b/src/server.c
index dee7c402a..380b20d32 100644
--- a/src/server.c
+++ b/src/server.c
@@ -897,6 +897,12 @@ void removeClientFromMemUsageBucket(client *c, int allow_eviction) {
* together clients consuming about the same amount of memory and can quickly
* free them in case we reach maxmemory-clients (client eviction).
*
+ * Note: This function filters clients of type monitor, master or replica regardless
+ * of whether the eviction is enabled or not, so the memory usage we get from these
+ * types of clients via the INFO command may be out of date. If someday we wanna
+ * improve that to make monitors' memory usage more accurate, we need to re-add this
+ * function call to `replicationFeedMonitors()`.
+ *
* returns 1 if client eviction for this client is allowed, 0 otherwise.
*/
int updateClientMemUsageAndBucket(client *c) {