From 7aad17dd0def259e1dbf97fc18a8cf9c3d15b47a Mon Sep 17 00:00:00 2001 From: Danno Tripp Date: Wed, 12 Mar 2025 20:33:14 -0700 Subject: [PATCH] =?UTF-8?q?Redis=20-=20Fix=20=E2=80=9CERR=20CLIENT=20CACHI?= =?UTF-8?q?NG=20YES=E2=80=9D=20Error=20in=20Client=20Tracking=20BCAST=20Mo?= =?UTF-8?q?de:=20Update=20client=20command=20processing=20code=20to=20allo?= =?UTF-8?q?w=20=E2=80=9CCLIENT=20CACHING=20YES=E2=80=9D=20in=20OPTIN=20OR?= =?UTF-8?q?=20BCAST=20mode.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: When using the redis client libraries such as rueidis and go-redis in Broadcast mode, the Redis server responds with the following error: “ERR CLIENT CACHING YES is only valid when tracking is enabled in OPTIN mode.” Redis and the client continue to work correctly and the client does not detect this error. However, the error count in INFO ERRORSTATS (server) increases. Fix: Update the redis Client Command processing code to allow “CLIENT CACHING YES” to be run in both “CLIENT TRACKING OPTIN” and “CLIENT TRACKING BCAST” mode. This change only alters the error reply behavior and not the client tracking logic, which was working as expected. Signed-off-by: Danno Tripp --- src/networking.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/networking.c b/src/networking.c index d6a62c56a..02fe1060c 100644 --- a/src/networking.c +++ b/src/networking.c @@ -3764,7 +3764,7 @@ NULL char *opt = c->argv[2]->ptr; if (!strcasecmp(opt,"yes")) { - if (c->flags & CLIENT_TRACKING_OPTIN) { + if (c->flags & CLIENT_TRACKING_OPTIN || c->flags & CLIENT_TRACKING_BCAST) { c->flags |= CLIENT_TRACKING_CACHING; } else { addReplyError(c,"CLIENT CACHING YES is only valid when tracking is enabled in OPTIN mode.");