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 2020/03/05 14:50:24 UTC

[GitHub] [couchdb] garrensmith commented on a change in pull request #2636: Clean up view size limit enforcement

garrensmith commented on a change in pull request #2636: Clean up view size limit enforcement
URL: https://github.com/apache/couchdb/pull/2636#discussion_r388337918
 
 

 ##########
 File path: src/couch_views/src/couch_views_indexer.erl
 ##########
 @@ -297,8 +299,13 @@ write_docs(TxDb, Mrst, Docs, State) ->
         last_seq := LastSeq
     } = State,
 
-    lists:foreach(fun(Doc) ->
-        couch_views_fdb:write_doc(TxDb, Sig, Views, Doc)
+    ViewIds = [View#mrview.id_num || View <- Views],
+    KeyLimit = key_size_limit(),
+    ValLimit = value_size_limit(),
+
+    lists:foreach(fun(Doc0) ->
+        Doc1 = calculate_kv_sizes(Mrst, Doc0, KeyLimit, ValLimit),
+        couch_views_fdb:write_doc(TxDb, Sig, ViewIds, Doc1)
 
 Review comment:
   I prefer that we pass in the Views here rather than the ViewId's. The extra loop to extract the ViewIds seems unnecessary

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services