linagora / james-project

Mirror of Apache James Project
Apache License 2.0
69 stars 63 forks source link

Redis: James should work normally when redis cluster change #5181

Open hungphan227 opened 3 weeks ago

hungphan227 commented 3 weeks ago

Why

James should be able to adapt and work normally when redis cluster change. For example, if one node (master or slave) in redis cluster is down, James should be able to detect, adapt new cluster structure to work normally.

How

Enable automatic topology update for redis client

DoD

Tests for RedisRateLimiter and RedisHealthCheck

hungphan227 commented 3 weeks ago

One issue I detected is that when one node in cluster is down, James would not be able to upload redis lua script

vttranlina commented 3 weeks ago

One issue I detected is that when one node in cluster is down, James would not be able to upload redis lua script

My debug with lettuce code: The method .scriptLoad was executed in all nodes of the cluster (both all master + slave) Then one node down -> scriptLoad will fail

ref: https://github.com/redis/lettuce/issues/590 io.lettuce.core.cluster.RedisAdvancedClusterAsyncCommandsImpl#scriptLoad io.lettuce.core.cluster.RedisAdvancedClusterAsyncCommandsImpl#executeOnNodes

hungphan227 commented 2 weeks ago

I posted a question in stackoverflow

https://stackoverflow.com/questions/78475444/why-does-lecttuce-send-lua-script-load-command-to-all-nodes-including-replicas

Arsnael commented 2 weeks ago

I think it's better to open an issue on the lettuce backlog, asking their community directly?

hungphan227 commented 2 weeks ago

https://github.com/redis/lettuce/issues/2853

Arsnael commented 1 week ago

Just a design decision regarding lettuce and redis. Honestly not a blocker, if it fails we just run without redis until it's back up.