-
Community Support Policy
RabbitMQ version used4.0.2 How is RabbitMQ deployed?Generic binary package Steps to reproduce the behavior in questionHi RabbitMQ team, This discussion is opened based on an existing question of mine posted on the rabbitmq-users group https://groups.google.com/g/rabbitmq-users/c/odCIK3qGpVM/m/jQk2icciAgAJ. We started experimenting with the new Khepri datastore provided with RabbitMQ 4.0.2 and noticed the following behavior during one of our tests: if we kill the current Khepri raft leader by hard resetting its host (as reported by the log message: "the RabbitMQ metadata store: detected a new leader...") it can take as much as 12 seconds for Khepri to elect a new leader and start accepting requests again. On the other hand, election is very fast if the current leader is gracefully stopped (usually under 1 second). We have some experience with using RAFT and know that raft has some timeout parameters that influence leader election process and think that we could tune these to make re-election faster in case the previous leader goes down unexpectedly. But, looking at the RabbitMQ 4.0 docs at https://www.rabbitmq.com/docs/metadata-store, we could not find out if this is possible. So, the question is, does RabbitMQ allow fine tunning the internal Khepri raft parameters at all via some environment variables? If not, is it something already on the roadmap ahead? We are asking because we are using RabbitMQ in a safety critical system and would need faster recovery times on average. Thanks in advance, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
@Rmarian Raft-based features in RabbitMQ use aten for peer failure detection. Aten implements a probabilistic failure detection algorithm, so reducing the time is not a matter of setting a key to a lower value in seconds. Here are the settings available in Just like with client connection heartbeats, very low threshold values (< 5s) are guaranteed to produce false positives in reasonably loaded production systems. |
Beta Was this translation helpful? Give feedback.
-
@Rmarian what is most likely happening here is that however you are force terminating your node leaves a dangling TCP connection on the other nodes so that we have to rely on the Ra (the library khepri is based on) favours leader stability over leader election latency during network partitions. I still would have thought 12s would be around the top end of what you should experience. What drives most of this latency is the I would recommend against it however. especially if you use quorum queues as frequent elections caused by false positives also have a negative effect on your availability properties |
Beta Was this translation helpful? Give feedback.
@Rmarian what is most likely happening here is that however you are force terminating your node leaves a dangling TCP connection on the other nodes so that we have to rely on the
aten
based failure detection instead of the more expedient erlang monitors.Ra (the library khepri is based on) favours leader stability over leader election latency during network partitions. I still would have thought 12s would be around the top end of what you should experience. What drives most of this latency is the
poll_interval
setting in theaten
application. in RabbitMQ this is set to a conservative 5s which affects quorum queues as well as khepri. lowering this by using theraft.adaptive_failure_detecto…