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 2018/03/04 05:09:03 UTC

[GitHub] davisp commented on a change in pull request #1201: This fixes couch_bt_engine:fold_local_docs/4

davisp commented on a change in pull request #1201: This fixes couch_bt_engine:fold_local_docs/4
URL: https://github.com/apache/couchdb/pull/1201#discussion_r172037448
 
 

 ##########
 File path: src/couch/src/couch_bt_engine.erl
 ##########
 @@ -464,7 +464,10 @@ fold_docs(St, UserFun, UserAcc, Options) ->
 
 
 fold_local_docs(St, UserFun, UserAcc, Options) ->
-    fold_docs_int(St, St#st.local_tree, UserFun, UserAcc, Options).
+    case fold_docs_int(St, St#st.local_tree, UserFun, UserAcc, Options) of
+        {ok, _Reds, FinalAcc} -> {ok, null, FinalAcc};
 
 Review comment:
   Good call. Its actually higher up when its expected to be null in fabric. What happens is that depending on what shards have actual docs you get a combination of null and 0 which leads to badarith exceptions when trying to do `0 + null` basically.
   
   This is definitely a bit of a sharp corner on PSE vs features that assume legacy engine behavior. But for v1 its mostly a game of trying to define existing behavior so that we can refine what's expected/acceptable for future engines.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services