Skip to content

Commit 3140d3b

Browse files
committed
MB-68093: Fix autofailover trim_needed check
It should take into account the current count Change-Id: I28d3e229003156c1ea56b8f6416cf5af13d1ecef Reviewed-on: https://review.couchbase.org/c/ns_server/+/232306 Well-Formed: Build Bot <[email protected]> Reviewed-by: Neelima Premsankar <[email protected]> Tested-by: Build Bot <[email protected]>
1 parent ae23b93 commit 3140d3b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/ns_server/src/auto_failover.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,8 @@ process_action({failover, NodesWithUUIDs}, S, DownNodes, NodeStatuses,
628628

629629
trim_needed(_Nodes, #state{disable_max_count = true}) ->
630630
false;
631-
trim_needed(Nodes, #state{max_count = Max}) ->
632-
length(Nodes) > Max.
631+
trim_needed(Nodes, #state{count = Count, max_count = Max}) ->
632+
Count + length(Nodes) > Max.
633633

634634
trim_nodes(Nodes, #state{count = Count, max_count = Max}) ->
635635
lists:sublist(Nodes, Max - Count).

0 commit comments

Comments
 (0)