chore(dsrepl): clarify how to perform leadership transfer in runtime

This commit is contained in:
Andrew Mayorov 2024-02-19 19:07:59 +01:00
parent 00d509f27b
commit e16aee99b4
No known key found for this signature in database
GPG Key ID: 2837C62ACFBFED5D
1 changed files with 3 additions and 0 deletions

View File

@ -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