davisp commented on a change in pull request #608: Calculate ExternalSize
Correctly for Views
URL: https://github.com/apache/couchdb/pull/608#discussion_r123805376
##########
File path: src/couch_mrview/src/couch_mrview_util.erl
##########
@@ -786,26 +788,32 @@ changes_ekey_opts(_StartSeq, #mrargs{end_key=EKey,
end.
+reduced_external_size(Tree) ->
+ case couch_btree:full_reduce(Tree) of
+ {ok, {_, _, Size}} -> Size;
+ % return null for versions of the reduce function without Size
+ {ok, {_, _}} -> null
Review comment:
You're crossing streams a bit here. This returns null when there's no
external size. But below your reduce function returns 0 when there's no
external size. This means that with no write, we'll get null, but the first
change will give us a number. We should pick one or the other.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services