Unverified Commit af0a4fe2 authored by sundb's avatar sundb Committed by GitHub
Browse files

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.
parent 7379d221
...@@ -593,7 +593,6 @@ void replicationFeedMonitors(client *c, list *monitors, int dictid, robj **argv, ...@@ -593,7 +593,6 @@ void replicationFeedMonitors(client *c, list *monitors, int dictid, robj **argv,
while((ln = listNext(&li))) { while((ln = listNext(&li))) {
client *monitor = ln->value; client *monitor = ln->value;
addReply(monitor,cmdobj); addReply(monitor,cmdobj);
updateClientMemUsageAndBucket(c);
} }
decrRefCount(cmdobj); decrRefCount(cmdobj);
} }
......
...@@ -897,6 +897,12 @@ void removeClientFromMemUsageBucket(client *c, int allow_eviction) { ...@@ -897,6 +897,12 @@ void removeClientFromMemUsageBucket(client *c, int allow_eviction) {
* together clients consuming about the same amount of memory and can quickly * together clients consuming about the same amount of memory and can quickly
* free them in case we reach maxmemory-clients (client eviction). * 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. * returns 1 if client eviction for this client is allowed, 0 otherwise.
*/ */
int updateClientMemUsageAndBucket(client *c) { int updateClientMemUsageAndBucket(client *c) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment