zachlankton commented on code in PR #4152:
URL: https://github.com/apache/couchdb/pull/4152#discussion_r952680366


##########
src/fabric/src/fabric_view_all_docs.erl:
##########
@@ -286,6 +286,20 @@ all_docs_concurrency() ->
             10
     end.
 
+validate_if_partition(Row, Acc) ->
+    QueryStr = Acc#vacc.req#httpd.qs,
+    case QueryStr of
+        undefined -> Row;
+        [{"partition", Id}] -> is_doc_in_partition(Row, Id)
+    end.
+is_doc_in_partition(Row, Id) ->
+    BinRowId = element(2, Row),
+    IsDocInPartition = binary:match(BinRowId, list_to_binary(Id)) /= nomatch,
+    case IsDocInPartition of
+        true -> Row;
+        false -> {view_row, BinRowId, undefined, undefined, undefined, 
undefined}

Review Comment:
   The current implementation passes this "dummy" row back into the call back 
on the `_all_docs` endpoint, so I do believe this is the correct way to handle 
missing documents.



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