You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I noticed that we are currently always waiting for the same amount of time during leader election (see here)
let mut tick_interval = tokio::time::interval(Duration::from_secs(lease_time / 2));
loop {
tick_interval.tick().await;
Maybe it makes sense to randomise this a bit and give different instances a slightly different tick_interval. This way we would space out requests a bit.
Well, I think it's not that necessary to do this, because: 1. eventually we will replace it with APIs of etcd lib or (some big refactoring); 2. even in current implementation, etcd will guarantee only one node will register successfully, it will ensure sequential writing of each requests.
I agree, it is not needed, but it would still reduce the likelihood of simultaneous election-runs that may then be repeated. Therefore I introduced this randomisation in #6466
(it really is just very few lines of code)
Is your feature request related to a problem? Please describe.
I noticed that we are currently always waiting for the same amount of time during leader election (see here)
Maybe it makes sense to randomise this a bit and give different instances a slightly different tick_interval. This way we would space out requests a bit.
CC @yezizp2012
Describe the solution you'd like
No response
Describe alternatives you've considered
No response
Additional context
Raft also uses randomised timeouts during leader election to avoid collisions
The text was updated successfully, but these errors were encountered: