rnewson commented on code in PR #6032:
URL: https://github.com/apache/couchdb/pull/6032#discussion_r3414346509
##########
src/fabric/src/fabric_doc_update.erl:
##########
@@ -339,32 +339,38 @@ good_reply(_, _) ->
-spec group_docs_by_shard(binary(), [#doc{}]) -> [{#shard{}, [#doc{}]}].
group_docs_by_shard(DbName, Docs) ->
+ Grouped = group_docs([{Doc, mem3:shards(DbName, Id)} || #doc{id = Id} =
Doc <- Docs]),
Review Comment:
not a huge concern but we'll call mem3:shards/2 quite often here, would it
be possible to get the shard list once (mem3:shards/1) and reuse that list. I'm
not as much concerned about performance as the weird case if the result of
mem3:shards/2 happens to change during this loop (if a shard split etc is
happening).
--
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]