rabbitmq / ra

A Raft implementation for Erlang and Elixir that strives to be efficient and make it easier to use multiple Raft clusters in a single system.
Other
813 stars 96 forks source link

Sparse read #255

Closed kjnilsson closed 2 years ago

kjnilsson commented 2 years ago

This implements a more efficient way of reading a list of non consecutive indexes from the Ra log using a new ra_log:sparse_read function. This can be used by RabbitMQ quorum queues to read messages due to be delivered to consumers in a faster manner.

There is also an optimisation where it will automatically read ahead if some of the indexes in the requested list form a consecutive run (as is likely to happen for RabbitMQ quorum queues also).