This is an automated email from the ASF dual-hosted git repository. nickva pushed a commit to branch fix-typo-in-mem3-reshard-dbdoc in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 9b70869d3dac5cf6c72b637c7ba371d2f56355e4 Author: Nick Vatamaniuc <[email protected]> AuthorDate: Mon Aug 24 16:36:09 2026 -0400 Fix typo in source check in mem3 reshard logic Previously we matched both the shard record and the shard name to the same variable. Fix the match and slighly improve readability by making a small function for it. --- src/mem3/src/mem3_reshard_dbdoc.erl | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/mem3/src/mem3_reshard_dbdoc.erl b/src/mem3/src/mem3_reshard_dbdoc.erl index e2f0d0c50..d03a53027 100644 --- a/src/mem3/src/mem3_reshard_dbdoc.erl +++ b/src/mem3/src/mem3_reshard_dbdoc.erl @@ -152,13 +152,7 @@ check_source_removed(#shard{name = Name}) -> Nodes = lists:usort([N || N <- ShardNodes, lists:member(N, Live)]), {Responses, _} = rpc:multicall(Nodes, mem3, shards, [DbName]), Shards = lists:usort(lists:flatten(Responses)), - SourcePresent = [ - S - || S = #shard{name = S, node = N} <- Shards, - S =:= Name, - N =:= node() - ], - case SourcePresent of - [] -> true; - [_ | _] -> false - end. + [] =:= matching_shards(Name, node(), Shards). + +matching_shards(Name, Node, Shards) -> + [S || #shard{name = SN, node = N} = S <- Shards, SN =:= Name, N =:= Node].
