Periodic cluster topology refresh is needed on top of Adaptive cluster topology refresh?

1,249 views
Skip to first unread message

mykev...@gmail.com

unread,
Nov 1, 2016, 5:39:21 PM11/1/16
to lettuce-redis-client-users
Hello,

I was going to enable periodic cluster topology refresh but just found that there is an option of enabling all adaptive refresh triggers just like the following code:

        final ClusterTopologyRefreshOptions clusterTopologyRefreshOptions = ClusterTopologyRefreshOptions.builder()
            .enablePeriodicRefresh(true)
            .enablePeriodicRefresh(10, TimeUnit.MINUTES)
            .enableAllAdaptiveRefreshTriggers()
            .build();

I came to think that, if I enable all adaptive refresh triggers, do I still need periodic refresh?  If I enable both of all adaptive and periodic refresh, then is the periodic refresh going to be supplementary in the sense that it will refresh the nodes that were not successful from the adaptive refresh?

Thank you in advance!
Kevin

Tuco

unread,
Nov 2, 2016, 5:27:39 AM11/2/16
to lettuce-redis-client-users, mykev...@gmail.com
Hi Kevin, 

As per my understanding, periodic refresh starts a background job which refreshes the cluster topology after every interval. Adaptive refresh will refresh the cluster topology in the client only if the lettuce gets a MOVED or ASK redirection when it performs an operation on the key.
So, you don't need the periodic refresh. But a good approach is to enable both and increment the time period of the periodic refresh to a few hours.

Just my opinion.

Thanks

mykev...@gmail.com

unread,
Nov 2, 2016, 3:29:13 PM11/2/16
to lettuce-redis-client-users, mykev...@gmail.com
Hi Tuco,

Thank you for your response.  That's my understanding too.  So I can increase the interval of periodic refresh when all adaptive refresh triggers are enabled.

If anyone else has a different thought, please let us know.

Thanks,
Kevin

Mark Paluch

unread,
Nov 3, 2016, 3:08:19 AM11/3/16
to lettuce-redis-client-users, mykev...@gmail.com
Agree with Tuco. The rationale behind having both is, that adaptive topology updates only make sense if you have enough traffic across your cluster. If you have nodes that are never touched by your application, they can't generate any MOVED (or other redirection) as the cluster changes. Therefore, it's a good idea to enable both refresh methods.

Cheers, 
Mark
Reply all
Reply to author
Forward
0 new messages