From 77c65266d0815cc849f38fc4eab118df8ebc1278 Mon Sep 17 00:00:00 2001 From: Andrew Mayorov Date: Mon, 19 Feb 2024 19:07:59 +0100 Subject: [PATCH] wip: clarify how to perform leadership transfer in runtime --- .../src/emqx_ds_replication_layer_shard.erl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/emqx_durable_storage/src/emqx_ds_replication_layer_shard.erl b/apps/emqx_durable_storage/src/emqx_ds_replication_layer_shard.erl index 223c5782c..d00e8fd9d 100644 --- a/apps/emqx_durable_storage/src/emqx_ds_replication_layer_shard.erl +++ b/apps/emqx_durable_storage/src/emqx_ds_replication_layer_shard.erl @@ -172,6 +172,9 @@ start_shard(DB, Shard) -> %% Ensure that doing that on node restart does not disrupt consensus. %% Edit: looks like it doesn't, this could actually be quite useful %% to "steal" leadership from nodes that have too much leader load. + %% TODO + %% It doesn't really work that way. There's `ra:transfer_leadership/2` + %% for that. try ra:trigger_election(LocalServer, _Timeout = 1_000) catch