tonysun83 commented on a change in pull request #849: Fix external size bug
when seq btree exists
URL: https://github.com/apache/couchdb/pull/849#discussion_r141911104
##########
File path: src/couch_mrview/src/couch_mrview_util.erl
##########
@@ -800,7 +800,10 @@ reduced_external_size(Tree) ->
case couch_btree:full_reduce(Tree) of
{ok, {_, _, Size}} -> Size;
% return 0 for versions of the reduce function without Size
- {ok, {_, _}} -> 0
+ {ok, {_, _}} -> 0;
+ % This is for the case when seq_btree or key_byseq_btree is not
+ % null. Reduces will return an integer.
+ {ok, Size} when is_integer(Size) -> Size
Review comment:
@davisp: So I think what you're saying is : for seq_btrees and
keyseq_btrees, there is no additional data outside the KVs. If external size
means uncompressed data that the user is going to store, then the total number
of bytes to store seq_btrees is exactly that because we generated it for the
user (who specified to include it). Therefore, couch_btree:size should be
sufficient.
Would want to to include the actual reduce value? so something like:
```couch_btree:size(SeqBtree) + ?term_size(reduce_external_size(SeqBtree))```
----------------------------------------------------------------
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