iilyak commented on a change in pull request #495: Couchdb 3288 mixed cluster 
upgrade
URL: https://github.com/apache/couchdb/pull/495#discussion_r113987906
 
 

 ##########
 File path: src/couch_mrview/src/couch_mrview_compactor.erl
 ##########
 @@ -53,8 +53,7 @@ compact(State) ->
         {ok, Fd} = couch_mrview_util:open_file(CompactFName),
         ESt = couch_mrview_util:reset_index(Db, Fd, State),
 
-        {ok, DbReduce} = couch_btree:full_reduce(Db#db.id_tree),
-        Count = element(1, DbReduce),
+        {ok, Count} = couch_db:get_doc_count(Db),
 
 Review comment:
   This could be a problem. The reduce result could be a tuple of either size 2 
or 3 (depending on age of view file). get_doc_count uses match so it would 
crash for tuples of size 2. See 
https://github.com/cloudant/dbcore/commit/a452a4ab3a46f88a203d0eaac69317e5069f7b1f#diff-0568f6a6952a18b42d6a57157a930333R255.
 We've found such views in production IRC (@eiri knows more details).
 
----------------------------------------------------------------
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

Reply via email to