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
798 stars 93 forks source link

WAL: drop entries with indexes lower or equal to the last snapshot #445

Closed kjnilsson closed 1 month ago

kjnilsson commented 1 month ago

In situations where the WAL lags behind but entries are still committed the WAL will still write entries with indexes lower than the last snapshot index for a given server. To avoid this unnessary work we no check the ra_log_snapshot_state table for each write and do not write them if they are lower than the snapshot index. This allows the wal a better chance to catch up on it's backlog.

Some changes needed to be made to the ra_log also to handle this new behaviour.