You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2022/10/05 20:06:40 UTC

[GitHub] [couchdb] nickva commented on a diff in pull request #4194: Introduce {rmin, R} option for fabric:handle_response/4,5

nickva commented on code in PR #4194:
URL: https://github.com/apache/couchdb/pull/4194#discussion_r985919864


##########
src/fabric/src/fabric_ring.erl:
##########
@@ -133,6 +140,10 @@ handle_response(Shard, Response, Workers, Responses, RingOpts, CleanupCb) ->
             #shard{range = [B, E]} = Shard,
             Responses1 = [{{B, E}, Shard, Response} | Responses],
             handle_response_ring(Workers1, Responses1, CleanupCb);
+        [{rmin, RMin}] when is_integer(RMin), RMin >= 1 ->

Review Comment:
   Since this is an internal function, the assumption is that by now the value of R has been checked above somewhere and this is more of an assert. It also goes along with the pattern in this function where we'd blow up with a case clause on unexpected `RingOpts` values.
   
   In general we could conceive of a case where R=0 means returns even if we we haven't completed the ring even once but it's more likely that we've just forgot to validate its value and that's not something we meant to do.



-- 
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: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org