-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RedisClusterNode without slots is never considered having same slots as an equal object #1089
Comments
Additionally, ClusterTopologyRefreshSchedulear call RedisClusterClient.reloadPartitions() The code however, will do Maybe i misunderstand the concept of periodic topology refresh, it seem it always update the internal data structure even if there is no change? |
Thanks for report. This is indeed a bug. Unchanged topology should not trigger a topology changed event and we should early return instead of invalidating caches. |
RedisClusterNode now correctly compares slot-less nodes. Previously two slot-less nodes where considered different although they should be considered equal.
RedisClusterNode now correctly compares slot-less nodes. Previously two slot-less nodes where considered different although they should be considered equal.
That's fixed now. |
Bug Report
Current Behavior
When using lettuce 5.1.7 connect to a redis cluster of 6 nodes (3 master and 3 slaves), we noticed the following log message all the time right after each periodic refresh:
upon further debugging, we noticed that
TopologyComparators.isChanged return TRUE all the time.
There is a new change in 5.1.7 that suppose to improve performance when comparing node slots.
408f771#diff-d4283d9d34b726c4de2d961ddde6186fR259
However, this.slot or other.slot is always NULL for slave nodes and hence it always think topology has changed.
The logic will not work for cluster that has slave (replicate) node, as any slave node will not have slot field being populated.
A sample cluster nodes command also indicates that slave nodes does not include slot info
Expected behavior/code
Periodic topology refresh should not reload partitions if topology has not changed.
Currently the system maybe busy keep refreshing partition information affect actual command execution.
Environment
Possible Solution
check for slave flag, if so, slot == null should not be treated as slot not the same.
or
use getSlot() which will replace null with empty set.
Additional context
The text was updated successfully, but these errors were encountered: