Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
khepri_cluster: Use key metrics to determine if a Ra server is running
[Why] The previous use of `ra:ping/2` was too expensive. As `khepri_cluster:is_store_running/1` is now used by `mnesia_to_khepri:is_migration_finished/2` and `mnesia_to_khepri:hande_fallback/5` since khepri_mnesia_migration 0.6.0, we saw a regression in performance in RabbitMQ because of this. khepri_mnesia_migration was using a very basic and incomplete version of `is_store_running()` before. That's why the issue was not spotted earlier. [How] The new code uses `ra:key_metrics/2` which simply checks if the process us running and query a few local counters. This is way faster because it does not send messages to the Ra server.
- Loading branch information