nickva commented on a change in pull request #3909:
URL: https://github.com/apache/couchdb/pull/3909#discussion_r795838752



##########
File path: src/fabric/src/fabric_doc_update.erl
##########
@@ -182,6 +193,34 @@ maybe_reply(Doc, Replies, {stop, W, Acc}) ->
             continue
     end.
 
+% This is a corner case where
+% 1) revision tree for the document are out of sync across nodes
+% 2) update on one node extends the revision tree
+% 3) VDU forbids the document
+% 4) remaining nodes do not extend revision tree, so noreply is returned
+% If at at least one node forbids the update, and all other replies
+% are noreply, then we reject the update
+check_forbidden_msg(Replies) ->
+    Pred = fun(R) ->
+        case R of 

Review comment:
       We could simply if it a tiny bit by matching in the function head to 
avoid an extra `case` statement
   
   It might look like this
   ```erlang
   Pred = fun
       ({_, {forbidden, _}}) -> true;
       (_) -> false
   end
   ```




-- 
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]


Reply via email to