From: Vsevolod Stakhov Date: Wed, 28 Jan 2026 09:05:25 +0000 (+0000) Subject: [Fix] Redis hyperscan cache: use write_servers for store/delete operations X-Git-Tag: 4.0.0~170 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d5b2b358e929338223045571a87ce04733f1a412;p=thirdparty%2Frspamd.git [Fix] Redis hyperscan cache: use write_servers for store/delete operations The redis_backend was missing is_write=true in attrs for store and delete operations, causing lua_redis.request to use read_servers instead of write_servers. This resulted in READONLY errors when read and write servers are configured separately. --- diff --git a/lualib/lua_hs_cache.lua b/lualib/lua_hs_cache.lua index 5f3435a98d..96e2a5fa29 100644 --- a/lualib/lua_hs_cache.lua +++ b/lualib/lua_hs_cache.lua @@ -579,6 +579,7 @@ function redis_backend:store(cache_key, platform_id, data, ttl, callback) local attrs = { ev_base = self.redis_params.ev_base, config = self.config, + is_write = true, callback = function(err) if err then lua_util.debugm(N, self.config, "redis SETEX failed for key %s: %s", key, err) @@ -608,6 +609,7 @@ function redis_backend:delete(cache_key, platform_id, callback) local attrs = { ev_base = self.redis_params.ev_base, config = self.config, + is_write = true, callback = function(err) if err then lua_util.debugm(N, self.config, "redis DEL failed for key %s: %s", key, err)