nickva commented on code in PR #5371:
URL: https://github.com/apache/couchdb/pull/5371#discussion_r1910781548
##########
src/fabric/src/fabric_doc_update.erl:
##########
@@ -318,13 +337,90 @@ group_docs_by_shard(DbName, Docs) ->
)
).
-append_update_replies([], [], DocReplyDict) ->
+%% use 'lowest' node that hosts this shard range as leader
+is_leader(Worker, Workers) ->
+ Worker == lists:min([W || W <- Workers, W#shard.range ==
Worker#shard.range]).
Review Comment:
Wonder what's being used to decide the "lowest" here. Workers have refs in
them, wouldn't those induce a random order, that wouldn't work for the general
idea of all coordinators picking one "leader" then independently.
If we want to decide based on node name or node name + shard range hash it
might be better to make that explicit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]