-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Is generation in clusterNodes.GC()
too old?
#3284
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
Comments
Hello @DingYuan0118, thank you for reaching out. We are officially supporting v9+ at the moment. If I have the bandwidth I will review this issue in the following weeks. |
@ndyakov hello, any updates for this? I think v9 has the same problem since I do not observe the code diff between v8 and v9(base on the branch name) for this part |
@DingYuan0118 as far as the timeframes are concerned you are correct and the output from your logs is expected. Older nodes will be removed from the active ones a minute after their last update. The described case with the switch of the cluster should not result in a connection drift, since when all activeNodes at the moment are down the slots (and activeNodes) are calculated by the response from the endpoint: Lines 1274 to 1284 in 86d418f
And the reloading will be triggered 200ms later: Lines 886 to 899 in 86d418f
Let me know if you have any more questions. |
@DingYuan0118 I will close this, feel free to reopen if you have additional questions. |
Uh oh!
There was an error while loading. Please reload this page.
Discussed in #3283
Originally posted by DingYuan0118 February 19, 2025
version: github.com/go-redis/redis/v8 v8.11.5
Since redis cluster client start to reload state every 10 seconds (Assume traffic always exists) likes below
and do
GC
one minute after theReload()
like:When it starts to do the GC, the generation it uses is from 1 minute ago. This will result in a gap between
clusterNode.generation
andGC generation
and causesactiveAddrs
are not updated in time. I add some support log to verify this:output like
We can find that nodes generation(which is 6) is greater than GC generation(which is 1).
If I wanna switch a redis cluster by operating the DNS record and shutting down the old cluster, it will take one minute to make the
activeAddrs
be the new cluster IPs. If the old cluster reboot in this one minute, it will causes the real connection drift between the two clusters.I wanna check is it an expected action or to prevent some problems?
The text was updated successfully, but these errors were encountered: